home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / WList / dcmdGlue.c < prev    next >
Encoding:
Text File  |  1993-07-27  |  1.3 KB  |  67 lines  |  [TEXT/KAHL]

  1. //
  2. //    dcmdGlue.c, source for the glue for writing 'dcmd' resources with THINK C
  3. //
  4. //    Daniel Jibouleau, 25/7/94
  5. //
  6.  
  7. #include "dcmd.h"
  8.  
  9. /* CommandEntry is the name of the dcmd routine.  It is called by main (entry point for the res.) */
  10. extern pascal void CommandEntry (dcmdBlock *pb);
  11.  
  12. /* main is the entry point for the dcmd resource.  It is the interface to the dcmd routine */
  13. pascal void main ()
  14. {
  15.     asm {
  16.             ori.b        #0, d2
  17.             jmp            CommandEntry
  18.             lea            0x2a(a5), a0
  19. extern dcmdDrawLine:
  20.             bsr.s        @1
  21. extern dcmdDrawString:
  22. @2        bsr.s        @1
  23. extern dcmdDrawText:
  24.             bsr.s        @1
  25. extern dcmdScroll:
  26.             bsr.s        @1
  27. extern dcmdDrawPrompt:
  28.             bsr.s        @1
  29. extern dcmdGetPosition:
  30.             bsr.s        @1
  31. extern dcmdSetPosition:
  32.             bsr.s        @1
  33. extern dcmdGetNextChar:
  34.             bsr.s        @1
  35. extern dcmdPeekAtNextChar:
  36.             bsr.s        @1
  37. extern dcmdGetNextParameter:
  38.             bsr.s        @1
  39. extern dcmdGetNextExpression:
  40.             bsr.s        @1
  41. extern dcmdGetBreakMessage:
  42.             bsr.s        @1
  43. extern dcmdGetNameAndOffset:
  44.             bsr.s        @1
  45. extern dcmdGetTrapName:
  46.             bsr.s        @1
  47. extern dcmdGetMacroName:
  48.             bsr.s        @1
  49. extern dcmdSwapWorlds:
  50.             bsr.s        @1
  51. extern dcmdSwapScreens:
  52.             bsr.s        @1
  53. extern dcmdForAllHeapBlocks:
  54.             bsr.s        @1
  55.             nop
  56. @1        move.l    (a7)+, d0
  57.             lea            @2, a1
  58.             sub.l        a1, d0
  59.             lsr.l        #1, d0
  60.             movea.l    (a7)+, a0
  61.             move.w    d0, -(a7)
  62.             move.l    a0, -(a7)
  63.             movea.l    4(a5), a0
  64.             jmp            (a0)
  65.         }
  66. }
  67.