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
/
ZSYS
/
SIMTEL20
/
SYSLIB
/
SLIB1.LBR
/
SCIN.Z80
< prev
next >
Wrap
Text File
|
2000-06-30
|
768b
|
41 lines
;
; SYSLIB Module Name: SCIN
; Author: Richard Conn
; SYSLIB Version Number: 3.6
; Module Version Number: 1.1
public cin
;
; CIN --
; CONSOLE INPUT ROUTINE
; INPUT CHARACTER FROM CON: INTO REG A
; AFFECT ONLY REG A AND FLAGS
;
PUTRG MACRO
PUSH BC ; SAVE BC, DE, HL
PUSH DE
PUSH HL
ENDM
GETRG MACRO
POP HL ; RESTORE HL, DE, BC
POP DE
POP BC
ENDM
CIN:
PUTRG ; SAVE REGISTERS
LD HL,(JTABL) ; GET ADDRESS OF JUMP TABLE
LD L,CI$OFF ; CONSOLE INPUT ADR
LD DE,CRET1 ; SET UP RET ADR
PUSH DE ; ... ON STACK
JP (HL)
CRET1: GETRG ; RESTORE REGISTERS
RET
BOOT EQU 0 ; CP/M BOOT ADDRESS
JTABL EQU BOOT+1 ; CP/M JUMP TABLE ADDRESS
CI$OFF EQU 9 ; CONSOLE INPUT OFFSET
END