home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / online / source / c / compilers / Tickle-4.0.sit.hqx / Tickle-4.0 / src / xcmd.a < prev    next >
Text File  |  1993-11-18  |  2KB  |  95 lines

  1. ;;
  2. ;; This source code was written by Tim Endres
  3. ;; Email: time@ice.com.
  4. ;; USMail: 8840 Main Street, Whitmore Lake, MI  48189
  5. ;;
  6. ;; Some portions of this application utilize sources
  7. ;; that are copyrighted by ICE Engineering, Inc., and
  8. ;; ICE Engineering retains all rights to those sources.
  9. ;;
  10. ;; Neither ICE Engineering, Inc., nor Tim Endres, 
  11. ;; warrants this source code for any reason, and neither
  12. ;; party assumes any responsbility for the use of these
  13. ;; sources, libraries, or applications. The user of these
  14. ;; sources and binaries assumes all responsbilities for
  15. ;; any resulting consequences.
  16. ;;
  17.  
  18.  
  19.             INCLUDE        'Traps.a'
  20.             
  21.             CASE        OBJECT
  22.             
  23.  
  24. ;
  25. ;        void CallXTCL(argc, argv, xpb, proc_ptr)
  26. ;                int                    argc;
  27. ;                char                *argv[];
  28. ;                XTCLParmBlk            *xpb;
  29. ;                ProcPtr                proc_ptr;
  30. ;
  31. ;
  32. ;CallXTCL    PROC    EXPORT
  33. ;            
  34. ;            ; DC.W        $A9FF
  35. ;            
  36. ;            MOVEM.L        A0, -(A7)            ; Save registers
  37. ;            
  38. ;            MOVEA.L        $10(A7), A0            ; Get  Command Block Pointer
  39. ;            MOVE.L        A0, -(A7)            ; Push Command Block Pointer
  40. ;            MOVEA.L        $10(A7), A0            ; Get  argv
  41. ;            MOVE.L        A0, -(A7)            ; Push argv
  42. ;            MOVEA.L        $10(A7), A0            ; Get  argc
  43. ;            MOVE.L        A0, -(A7)            ; Push argc
  44. ;            MOVEA.L        $20(A7), A0            ; Get Procedure Pointer (pushed up 12!)
  45. ;
  46. ;            JSR            (A0)                ; Call pascal XTCL routine.
  47. ;            ADDA.W        #$0C, A7            ; C procedures do NOT remove their paramaters...
  48. ;            
  49. ;            MOVEM.L        (A7)+, A0            ; Restore registers;
  50. ;
  51. ;                ; No return result...
  52. ;                
  53. ;            RTS
  54. ;            
  55.                         
  56.  
  57. ;
  58. ;        pascal int XTCLCallBack(cpb, script_handle, result_handle, stdout_handle)
  59. ;                int                    argc;
  60. ;                char                *argv[];
  61. ;                XTCLParmBlk            *xpb;
  62. ;
  63. ;
  64.             CASE        OFF    ; Pascal names!!!
  65.             
  66. XTCLCallBack    PROC    EXPORT
  67.             
  68.             ; DC.W        $A9FF
  69.             
  70.             MOVEM.L        A0, -(A7)            ; Save registers
  71.             
  72. ;    XTCL_Eval_CallBack(cpb, script_handle, result_handle, stdout_handle)
  73.  
  74.             MOVEA.L        $8(A7), A0            ; Get  stdout_handle
  75.             MOVE.L        A0, -(A7)            ; Push stdout_handle
  76.             MOVEA.L        $10(A7), A0            ; Get  result_handle
  77.             MOVE.L        A0, -(A7)            ; Push result_handle
  78.             MOVEA.L        $18(A7), A0            ; Get  script_handle
  79.             MOVE.L        A0, -(A7)            ; Push script_handle
  80.             MOVEA.L        $20(A7), A0            ; Get  cpb
  81.             MOVE.L        A0, -(A7)            ; Push cpb
  82.             MOVEA.L        $16(A0), A0            ; Get Procedure Pointer (22 bytes from structure start)
  83.  
  84.             JSR            (A0)                ; Call C callback routine.
  85.             ADDA.W        #$10, A7            ; C procedures DO NOT remove their paramaters...
  86.             MOVE.L        D0, $18(A7)            ; Get  return value.
  87.             
  88.             MOVEM.L        (A7)+, A0            ; Restore registers
  89.  
  90.             RTS
  91.             
  92.             CASE        OBJECT
  93.  
  94.             END
  95.