home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / dev / c / rkrm / sampledevice / asmsupp.i next >
Text File  |  1992-09-03  |  2KB  |  67 lines

  1. *************************************************************************
  2. *
  3. *    Copyright (C) 1985, Commodore Amiga Inc.  All rights reserved.
  4. *    Permission granted for non-commercial use
  5. *
  6. * asmsupp.i -- random low level assembly support routines
  7. *           used by the Commodore sample Library & Device
  8. *
  9. *************************************************************************
  10. CLEAR    MACRO        ;quick way to clear a D register on 68000
  11.     MOVEQ    #0,\1
  12.     ENDM
  13.  
  14. ;BHS     MACRO
  15. ;     BCC.\0  \1 ;\0 is the extension used on the macro (such as ".s")
  16. ;     ENDM
  17. ;BLO     MACRO
  18. ;     BCS.\0  \1
  19. ;     ENDM
  20. ;EVEN     MACRO         ; word align code stream
  21. ;     DS.W     0
  22. ;     ENDM
  23.  
  24. LINKSYS MACRO        ; link to a library without having to see a _LVO
  25.     MOVE.L    A6,-(SP)
  26.     MOVE.L    \2,A6
  27.     JSR    _LVO\1(A6)
  28.     MOVE.L    (SP)+,A6
  29.     ENDM
  30.  
  31. CALLSYS MACRO        ; call a library via A6 without having to see _LVO
  32.     JSR    _LVO\1(A6)
  33.     ENDM
  34.  
  35. XLIB    MACRO        ; define a library reference without the _LVO
  36.     XREF    _LVO\1
  37.     ENDM
  38. ;
  39. ; Put a message to the serial port at 9600 baud.  Used as so:
  40. ;
  41. ;     PUTMSG   30,<'%s/Init: called'>
  42. ;
  43. ; Parameters can be printed out by pushing them on the stack and
  44. ; adding the appropriate C printf-style % formatting commands.
  45. ;
  46.         XREF    KPutFmt
  47. PUTMSG:     MACRO    * level,msg
  48.  
  49.         IFGE    INFO_LEVEL-\1
  50.  
  51.         PEA    subSysName(PC)
  52.         MOVEM.L A0/A1/D0/D1,-(SP)
  53.         LEA    msg\@(pc),A0    ;Point to static format string
  54.         LEA    4*4(SP),A1      ;Point to args
  55.         JSR    KPutFmt
  56.         MOVEM.L (SP)+,D0/D1/A0/A1
  57.         ADDQ.L    #4,SP
  58.         BRA.S    end\@
  59.  
  60. msg\@        DC.B    \2
  61.         DC.B    10
  62.         DC.B    0
  63.         DS.W    0
  64. end\@
  65.         ENDC
  66.         ENDM
  67.