home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / devcon / milan_1991 / devcon91.3 / debug / examples / rawprintf.asm < prev    next >
Assembly Source File  |  1992-09-01  |  1KB  |  46 lines

  1. *************************************************************************
  2. *
  3. * _RawPrintf.asm  - Self-contained printf clone.  Formatted strings
  4. *            are sent directly out the serial port.  Xon/Xoff
  5. *            handshake is supported.
  6. *            This function may be called at any time, including
  7. *            interrupts.
  8. *
  9. *    Bryce Nesbitt, 02-24-89
  10. *
  11. *************************************************************************
  12.  
  13.         XREF    _LVORawDoFmt
  14.         XDEF    _RawPrintf
  15.  
  16. _RawPrintf:
  17.         movem.l a0/a1,-(sp)
  18.         move.l    4*3(SP),A0      ;grab format string
  19.         lea.l    4*4(SP),A1      ;grab stack address of parameters
  20.         movem.l A2/A3/A6/D0/D1,-(SP)
  21.         move.l    4,a6
  22.         lea.l    PSCODE(pc),a2
  23.         suba.l    a3,a3
  24.         jsr    _LVORawDoFmt(A6)
  25.         movem.l (SP)+,D0/D1/A2/A3/A6
  26.         movem.l (sp)+,a0/a1
  27.         rts
  28.  
  29.  
  30. PSCODE:     tst.b    d0
  31.         beq.s    ignore
  32. 1$        move.w    $DFF018,d1    ;_serdatr
  33.         btst    #13,d1        ;TBE bit
  34.         beq.s    1$
  35.         and.b    #$7f,d1
  36.         cmp.b    #$18,d1     ;Check for CAN (^X)
  37.         beq.s    ignore
  38.         cmp.b    #$13,d1     ;Check for Xoff
  39.         beq.s    1$
  40.         and.w    #$ff,d0
  41.         or.w    #$100,d0
  42.         move.w    d0,$DFF030    ;_serdat
  43. ignore:     rts
  44.  
  45.         END
  46.