This commit is contained in:
Matthias@Dell 2024-01-15 09:18:49 +01:00
parent eb2fb061a0
commit c61de15048

47
programs/viu.s65 Normal file
View File

@ -0,0 +1,47 @@
.include "lcd.h65"
.include "ps2_keyboard_text_handler.h65"
.import home:absolute
.zeropage
ptr: .res 2
.bss
buffer: .res 256
.code
.proc init
stz ptr
stz ptr+1
stz buffer
.endproc
.proc insert_mode
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 k_esacpe
cmp #kb::K::PRINT
beq clear_display
cmp #kb::K::BACKSPACE
beq k_backspace
bra loop
k_esacpe:
jmp home
clear_display:
jsr lcd::clear
bra loop
k_backspace:
; go back
lda ' '
.endproc