2023-03-04 22:09:40 +00:00
|
|
|
org 0x1000
|
|
|
|
|
|
|
|
prhex = $c174
|
|
|
|
putchar = $c45e
|
2023-09-25 19:03:24 +00:00
|
|
|
putstr = $c01b
|
2023-03-04 22:09:40 +00:00
|
|
|
|
|
|
|
PUBLIC _main
|
|
|
|
_main:
|
2023-09-25 19:03:24 +00:00
|
|
|
in a,($81)
|
|
|
|
set 0,a
|
|
|
|
out ($81),a
|
|
|
|
|
|
|
|
ld a,($42)
|
|
|
|
ld ($d0a0),a
|
|
|
|
|
|
|
|
jp ASMPC
|
2023-03-04 22:09:40 +00:00
|
|
|
|
|
|
|
|
2023-09-25 19:03:24 +00:00
|
|
|
ld a,$40
|
|
|
|
ld ($d77f),a
|
|
|
|
|
|
|
|
ld hl,613
|
|
|
|
main_loop:
|
|
|
|
push hl
|
|
|
|
call putstr
|
|
|
|
BYTE "abc"
|
|
|
|
BYTE "\0"
|
|
|
|
pop hl
|
|
|
|
dec hl
|
2023-03-04 22:09:40 +00:00
|
|
|
ld a,l
|
2023-09-25 19:03:24 +00:00
|
|
|
or h
|
|
|
|
jp nz,main_loop
|
2023-03-04 22:09:40 +00:00
|
|
|
|
2023-09-25 19:03:24 +00:00
|
|
|
back:
|
|
|
|
call uart_rx
|
|
|
|
cp $61
|
|
|
|
jp z,log
|
|
|
|
ld c,a
|
|
|
|
call putchar
|
|
|
|
jp back
|
2023-03-04 22:09:40 +00:00
|
|
|
|
|
|
|
jp ASMPC
|
|
|
|
|
2023-09-25 19:03:24 +00:00
|
|
|
log:
|
|
|
|
ld a,($ffd5)
|
|
|
|
call prhex
|
|
|
|
ld a,($ffd4)
|
|
|
|
call prhex
|
|
|
|
jp back
|
2023-03-04 22:09:40 +00:00
|
|
|
|
|
|
|
delay:
|
|
|
|
push de
|
|
|
|
ld de,$0000
|
|
|
|
delay_loop:
|
|
|
|
dec de
|
|
|
|
ld a,d
|
|
|
|
or e
|
|
|
|
jr nz,delay_loop
|
|
|
|
|
|
|
|
pop de
|
2023-09-25 19:03:24 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
uart_rx:
|
|
|
|
in a,($b1)
|
|
|
|
and $01
|
|
|
|
jr z,uart_rx
|
|
|
|
in a,($b0)
|
|
|
|
ret
|
|
|
|
|
|
|
|
uart_tx:
|
|
|
|
in a,($b1)
|
|
|
|
and $04
|
|
|
|
jr z,uart_tx
|
|
|
|
ld a,c
|
|
|
|
out ($b0),a
|
|
|
|
ret
|