home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff339.lzh / PCQ / Runtime.lzh / Runtime / Writers / writepad.asm < prev    next >
Assembly Source File  |  1989-11-20  |  894b  |  34 lines

  1.  
  2. *    WritePad.asm (of PCQ Pascal runtime library)
  3. *    Copyright (c) 1989 Patrick Quaid
  4.  
  5. *    This routine just puts out spaces to a file.
  6.  
  7. *    Upon entry, this routine expects the file record in a0 and
  8. *    the number of spaces to write in d0.  a0 is preserved.
  9.  
  10.     INCLUDE    ":runtime/FileRec.i"
  11.  
  12.     XREF    _p%FlushBuffer
  13.     XREF    _p%IOResult
  14.  
  15.     XDEF    _p%PadOut
  16. _p%PadOut
  17.     tst.l    _p%IOResult        ; is IOResult OK?
  18.     bne    3$            ; if not, leave now
  19.     subq.l    #1,d0            ; for dbra below
  20.     move.l    CURRENT(a0),a1        ; get the current pointer
  21. 1$    move.b    #' ',(a1)+        ; put a space into the buffer
  22.     cmpa.l    MAX(a0),a1        ; are we at end?
  23.     blt.s    2$            ; if not, skip this
  24.     move.l    a1,CURRENT(a0)        ; save pointer
  25.     move.l    d0,-(sp)        ; save count
  26.     jsr    _p%FlushBuffer        ; write out the buffer
  27.     move.l    (sp)+,d0        ; retreive count
  28.     move.l    CURRENT(a0),a1        ; get current pointer back
  29. 2$    dbra    d0,1$            ; loop
  30.     move.l    a1,CURRENT(a0)        ; set pointer
  31. 3$    rts
  32.  
  33.     END
  34.