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
/
writechar.asm
< prev
next >
Wrap
Assembly Source File
|
1989-11-20
|
768b
|
32 lines
* WriteChar.asm (of PCQ Pascal runtime library)
* Copyright (c) 1989 Patrick Quaid
* This routine writes a single character to a text file
SECTION ONE
XREF outbuffer
XREF _p%PadOut
XREF _p%WriteText
XREF _p%IOResult
XDEF _p%WriteChar
_p%WriteChar:
tst.l _p%IOResult ; is everything OK
bne 2$ ; if not, skip
move.b d0,outbuffer ; put the character into the buffer
move.l 6(sp),a0 ; load up the file record address
move.w 4(sp),d0 ; get number of pads
ext.l d0 ; make it 32 bits for safety
subq.l #1,d0 ; minus one for the character itself
ble.s 1$ ; if it's <= 0 then skip
jsr _p%PadOut ; write pad spaces
1$ move.l #outbuffer,a1 ; get address of buffer
moveq.l #1,d3 ; one character long
jsr _p%WriteText ; write the character
2$ rts
END