6502-OS/programs/ps2_keyboard_printer.s65

34 lines
498 B
Plaintext
Raw Normal View History

2024-01-09 02:29:45 +01:00
.include "lcd.h65"
.include "ps2_keyboard_text_handler.h65"
.export ps2_keyboard_printer
.import home:absolute
.code
.proc ps2_keyboard_printer
jsr lcd::clear
jsr kb::init
loop:
lda kb::char
beq @no_char
stz kb::char
jsr lcd::print_char
bra loop
@no_char:
lda kb::keycode
beq loop
cmp #kb::K::ESCAPE
beq @esacpe
cmp #kb::K::PRINT
beq @clear_display
bra loop
@esacpe:
jmp home
@clear_display:
jsr lcd::clear
bra loop
.endproc