1985-03-18 13:15:00 +00:00
|
|
|
.define getchar, putchar
|
1987-01-28 15:03:39 +00:00
|
|
|
.sect .text
|
|
|
|
.sect .rom
|
|
|
|
.sect .data
|
|
|
|
.sect .bss
|
|
|
|
.sect .text
|
1985-03-18 13:15:00 +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 0xF1
|
|
|
|
ani 1
|
|
|
|
jz getchar
|
|
|
|
in 0xF0
|
|
|
|
cpi 0x0D
|
|
|
|
jnz 1f
|
|
|
|
mvi a,0x0A
|
|
|
|
1: ret
|
|
|
|
|
|
|
|
! Write character on HERMAC monitor
|
|
|
|
! Assumes character in a-reg
|
|
|
|
|
|
|
|
putchar:
|
|
|
|
cpi 0x0A
|
|
|
|
jnz 1f
|
|
|
|
mvi a,0x1F
|
|
|
|
1: push psw
|
|
|
|
2: in 0xF1
|
|
|
|
ani 4
|
|
|
|
jz 2b
|
|
|
|
pop psw
|
|
|
|
out 0xF0
|
|
|
|
ret
|