mirror of
https://github.com/irmen/prog8.git
synced 2024-08-25 08:28:59 +00:00
47 lines
843 B
Lua
47 lines
843 B
Lua
%import textio
|
|
%import conv
|
|
%import floats
|
|
%zeropage basicsafe
|
|
|
|
main {
|
|
|
|
sub start() {
|
|
|
|
ubyte[] array = [1,2,3,4]
|
|
|
|
const ubyte ic = 2
|
|
ubyte ib = 2
|
|
|
|
ib = array[ic+1]
|
|
ib = array[ib]
|
|
ib = array[ib+1]
|
|
ib = array[ib+2]
|
|
ib = array[ib-1]
|
|
ib = array[ib-2]
|
|
ib = array[ib*2]
|
|
ib = array[2*ib]
|
|
ib = array[ib*3]
|
|
ib = array[3*ib]
|
|
ib = array[ib*4]
|
|
ib = array[4*ib]
|
|
; ib = array[lsb(ib)]
|
|
; ib = array[msb(ib)]
|
|
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
|
|
}}
|
|
}
|
|
}
|