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 / writecharray.asm < prev    next >
Assembly Source File  |  1989-11-20  |  747b  |  33 lines

  1. *
  2. *    WriteCharray.asm (of PCQ Pascal runtime library)
  3. *    Copyright (c) 1989 Patrick Quaid
  4. *
  5.  
  6. *    Write a character array to a text file.
  7.  
  8.     SECTION    ONE
  9.  
  10.     XREF    _p%PadOut
  11.     XREF    _p%WriteText
  12.     XREF    _p%IOResult
  13.  
  14.     XDEF    _p%WriteCharray
  15. _p%WriteCharray
  16.  
  17.     tst.l    _p%IOResult        ; is IO OK?
  18.     bne    2$            ; if not, leave
  19.     move.l    6(sp),a0        ; get file record address
  20.     move.w    4(sp),d1        ; get field width
  21.     ext.l    d1            ; make it 32 bit
  22.     sub.l    d3,d1            ; subtract actual width
  23.     ble.s    1$            ; if less than, skip this
  24.     movem.l    d0/d3,-(sp)        ; save address and length
  25.     move.l    d1,d0            ; set up for call
  26.     jsr    _p%PadOut        ; write the pad characters
  27.     movem.l    (sp)+,d0/d3        ; restore address and length
  28. 1$    move.l    d0,a1            ; set up for call
  29.     jsr    _p%WriteText        ; write the array
  30. 2$    rts
  31.  
  32.     END
  33.