ack/mach/z80/libsys/char.her.s
1985-04-01 14:44:26 +00:00

32 lines
429 B
ArmAsm

.define getchar, putchar
! These getchar and putchar routines can be used for HERMAC computer
! Read a character from HERMAC-monitor
! Character is returned in a-reg
getchar:
in a,0xF1
and 1
jp z,getchar
in a,0xF0
cp 0x0D
jp nz,1f
ld a,0x0A
1: ret
! Write character on HERMAC monitor
! Assumes character in a-reg
putchar:
cp 0x0A
jp nz,1f
ld a,0x1F
1: push af
2: in a,0xF1
and 4
jp z,2b
pop af
out 0xF0,a
ret