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
/
Readers
/
readchar.asm
< prev
next >
Wrap
Assembly Source File
|
1989-11-20
|
683b
|
31 lines
* ReadChar.asm (of PCQ Pascal runtime library)
* Copyright (c) 1989 Patrick Quaid
* This reads one character from a text file.
INCLUDE ":runtime/FileRec.i"
SECTION ONE
XREF _p%ReadOneChar
XREF _p%GetThatChar
XREF _p%IOResult
* Upon entry we expect a0 to hold the variable address, and
* the top of the stack should be the file record address.
XDEF _p%ReadChar
_p%ReadChar
tst.l _p%IOResult ; is IO OK?
bne.s 1$
move.l a0,-(sp) ; save the variable address
move.l 8(sp),a0 ; get the file record address
jsr _p%ReadOneChar ; read a character
jsr _p%GetThatChar ; eat it
move.l (sp)+,a0 ; restore var address
move.b d0,(a0) ; save the character
1$ rts
END