ceda-code-experiments/main.asm

112 lines
1.8 KiB
NASM

org 0x1000
prhex = $c174
putchar = $c45e
putstr = $c01b
PUBLIC _main
_main:
; "CIAO" vertical stretch
ld a,$43
ld ($d000),a
ld ($d050),a
ld a,$49
ld ($d001),a
ld ($d051),a
ld a,$41
ld ($d002),a
ld ($d052),a
ld a,$4f
ld ($d003),a
ld ($d053),a
ld a,$80
out ($81),a
ld a,$60
ld ($d000),a
ld ($d001),a
ld ($d002),a
ld ($d003),a
ld a,$70
ld ($d050),a
ld ($d051),a
ld ($d052),a
ld ($d053),a
ld a,$00
out ($81),a
; "PIPPO" with blinking underline
ld a,$50
ld ($d010),a
ld a,$49
ld ($d011),a
ld a,$50
ld ($d012),a
ld a,$50
ld ($d013),a
ld a,$4f
ld ($d014),a
ld a,$80
out ($81),a
ld a,$20
ld ($d010),a
ld ($d011),a
ld ($d012),a
ld ($d013),a
ld ($d014),a
ld a,$00
out ($81),a
; "ABC" underline and overline
ld a,$41
ld ($d020),a
ld a,$42
ld ($d021),a
ld a,$43
ld ($d022),a
ld a,$80
out ($81),a
ld a,$50
ld ($d020),a
ld ($d021),a
ld ($d022),a
ld a,$00
out ($81),a
jp ASMPC
delay:
push de
ld de,$0000
delay_loop:
dec de
ld a,d
or e
jr nz,delay_loop
pop de
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