mirror of
https://github.com/irmen/prog8.git
synced 2024-11-04 19:05:57 +00:00
eb018ae660
use adc array,y or sbc array,y instead of tempvar
37 lines
810 B
Lua
37 lines
810 B
Lua
%import textio
|
|
%zeropage basicsafe
|
|
|
|
main {
|
|
sub start() {
|
|
|
|
ubyte[5] xx = [11,22,33,44,55]
|
|
ubyte[5] yy = [101,102,103,104,105]
|
|
ubyte i=3
|
|
ubyte j = 4
|
|
uword screen
|
|
|
|
ubyte result = xx[i] + yy[j]
|
|
txt.print_ub(result) ; 149
|
|
txt.nl()
|
|
result = xx[i] + yy[i]
|
|
txt.print_ub(result) ; 148
|
|
txt.nl()
|
|
@(screen+i) = xx[i] + yy[i]
|
|
|
|
; ubyte index = 100
|
|
; ubyte[] t_index = [1,2,3,4,5]
|
|
; ubyte nibble = 0
|
|
;
|
|
; index = index + t_index[4]
|
|
; index = index + t_index[nibble]
|
|
; txt.print_ub(index) ; 106
|
|
; txt.nl()
|
|
;
|
|
; nibble++
|
|
; index = index - t_index[3]
|
|
; index = index - t_index[nibble]
|
|
; txt.print_ub(index) ; 100
|
|
; txt.nl()
|
|
}
|
|
}
|