mirror of
https://github.com/irmen/prog8.git
synced 2024-11-02 07:05:14 +00:00
42 lines
687 B
Lua
42 lines
687 B
Lua
%import textio
|
|
%import conv
|
|
%import floats
|
|
%zeropage basicsafe
|
|
|
|
main {
|
|
|
|
sub start() {
|
|
|
|
uword zc
|
|
|
|
zc = 99
|
|
scolor2=scolor
|
|
|
|
; TODO WHy does this compile with stack eval:
|
|
ubyte scolor = (zc>>13) as ubyte + 4
|
|
|
|
; TODO this is more optimized:
|
|
ubyte scolor2
|
|
scolor2 = (zc>>13) as ubyte + 4
|
|
|
|
scolor2=scolor
|
|
|
|
testX()
|
|
}
|
|
|
|
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
|
|
}}
|
|
}
|
|
}
|