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 >
Wrap
Assembly Source File
|
1989-11-20
|
894b
|
34 lines
* WritePad.asm (of PCQ Pascal runtime library)
* Copyright (c) 1989 Patrick Quaid
* This routine just puts out spaces to a file.
* Upon entry, this routine expects the file record in a0 and
* the number of spaces to write in d0. a0 is preserved.
INCLUDE ":runtime/FileRec.i"
XREF _p%FlushBuffer
XREF _p%IOResult
XDEF _p%PadOut
_p%PadOut
tst.l _p%IOResult ; is IOResult OK?
bne 3$ ; if not, leave now
subq.l #1,d0 ; for dbra below
move.l CURRENT(a0),a1 ; get the current pointer
1$ move.b #' ',(a1)+ ; put a space into the buffer
cmpa.l MAX(a0),a1 ; are we at end?
blt.s 2$ ; if not, skip this
move.l a1,CURRENT(a0) ; save pointer
move.l d0,-(sp) ; save count
jsr _p%FlushBuffer ; write out the buffer
move.l (sp)+,d0 ; retreive count
move.l CURRENT(a0),a1 ; get current pointer back
2$ dbra d0,1$ ; loop
move.l a1,CURRENT(a0) ; set pointer
3$ rts
END