ack/mach/z80/libmon/char.her.s

37 lines
487 B
ArmAsm
Raw Normal View History

1985-04-01 14:44:26 +00:00
.define getchar, putchar
1987-02-02 12:44:39 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1985-04-01 14:44:26 +00:00
! 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