home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Reference_Library / lib_examples / asmsupp.i < prev    next >
Encoding:
Text File  |  1992-08-21  |  1.6 KB  |  52 lines

  1. *******************************************************************************************
  2. *assorted low level assembly support routines used by the Commodore sample Library & Device
  3. *******************************************************************************************
  4. CLEAR   MACRO           ;quick way to clear a D register on 68000
  5.         MOVEQ   #0,\1
  6.         ENDM
  7.  
  8. LINKSYS MACRO           ; link to a library without having to see a _LVO
  9.         MOVE.L  A6,-(SP)
  10.         MOVE.L  \2,A6
  11.         JSR     _LVO\1(A6)
  12.         MOVE.L  (SP)+,A6
  13.         ENDM
  14.  
  15. CALLSYS MACRO           ; call a library via A6 without having to see _LVO
  16.         JSR     _LVO\1(A6)
  17.         ENDM
  18.  
  19. XLIB    MACRO           ; define a library reference without the _LVO
  20.         XREF    _LVO\1
  21.         ENDM
  22. ;
  23. ; Put a message to the serial port at 9600 baud.  Used as so:
  24. ;
  25. ;     PUTMSG   30,<'%s/Init: called'>
  26. ;
  27. ; Parameters can be printed out by pushing them on the stack and
  28. ; adding the appropriate C printf-style % formatting commands.
  29. ;
  30.                 XREF    KPutFmt
  31. PUTMSG:         MACRO   * level,msg
  32.  
  33.                 IFGE    INFO_LEVEL-\1
  34.  
  35.                 PEA     subSysName(PC)
  36.                 MOVEM.L A0/A1/D0/D1,-(SP)
  37.                 LEA     msg\@(pc),A0    ;Point to static format string
  38.                 LEA     4*4(SP),A1      ;Point to args
  39.                 JSR     KPutFmt
  40.                 MOVEM.L (SP)+,D0/D1/A0/A1
  41.                 ADDQ.L  #4,SP
  42.                 BRA.S   end\@
  43.  
  44. msg\@           DC.B    \2
  45.                 DC.B    10
  46.                 DC.B    0
  47.                 DS.W    0
  48. end\@
  49.                 ENDC
  50.                 ENDM
  51.  
  52.