prog8/examples/test.p8
2020-10-11 18:36:20 +02:00

44 lines
716 B
Lua

%import textio
%import syslib
%import floats
%zeropage basicsafe
main {
sub start() {
str name = "irmen de jong"
uword strptr = &name
txt.print("ubyte? ")
void txt.input_chars(name)
ubyte ub = conv.str2ubyte(name)
txt.print_ub(ub)
txt.print("\nbyte? ")
void txt.input_chars(name)
byte bb = conv.str2byte(name)
txt.print_b(bb)
}
asmsub testX() {
%asm {{
stx _saveX
lda #13
jsr txt.chrout
lda _saveX
jsr txt.print_ub
lda #13
jsr txt.chrout
ldx _saveX
rts
_saveX .byte 0
}}
}
}