home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
F
/
LZH21SRC.LBR
/
GETCPUTC.MYC
/
GETCPUTC.MYC
Wrap
Text File
|
2000-06-30
|
1KB
|
65 lines
;
; GETC_ - Get a character from user routine
;
; Action - Registers saved and user routine is called to fetch
; a character.
; Input - none
; Output - char is in A reg. On EOF carry flag is set
; Entry - getc_
; Registers - All preserved but A:PSW
; Calls - none
CSEG
GETC_:
PUSH H ; Save
PUSH D ; Save
PUSH B ; Save
IF CRUNCH
EXTRN GLZHEN
CALL GLZHEN
ELSE
EXTRN GLZHUN
CALL GLZHUN
ENDIF
POP B ; Get
POP D ; Get
POP H ; Get
RET ; Exit
; PUTC_ - Char to output
;
; Action - Char is output to user's routine. All regs are saved.
; User routine is called with ZERO bit set every 256
; characters
; Input - A register is character to output
; Output - As above
; Entry - putc_
; Registers - All registers preserved except A:PSW
; Calls - none
;
DSEG
PUTCCNT:DS 1 ; Output character count
CSEG
PUTC_:
PUSH H ; Save
PUSH D ; Save
PUSH B ; Save
LXI H,PUTCCNT ; Point to counter
DCR M ; Will be zero every 256
IF CRUNCH
EXTRN PLZHEN
CALL PLZHEN
ELSE
EXTRN PLZHUN
CALL PLZHUN
ENDIF
POP B ; Get
POP D ; Get
POP H ; Get
RET ; Exit