2022-10-22 13:33:35 +02:00
|
|
|
%import floats
|
2022-10-26 23:53:17 +02:00
|
|
|
%import textio
|
2022-10-22 13:33:35 +02:00
|
|
|
%zeropage basicsafe
|
2022-10-19 23:23:49 +02:00
|
|
|
|
2022-10-22 13:33:35 +02:00
|
|
|
main {
|
2022-10-26 23:53:17 +02:00
|
|
|
byte[10] foo
|
|
|
|
ubyte[10] foou
|
|
|
|
word[10] foow
|
|
|
|
uword[10] foowu
|
|
|
|
float[10] flt
|
|
|
|
byte d
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
; foo[0] = -d ; TODO fix codegen in assignExpression that splits this up
|
2022-10-19 23:23:49 +02:00
|
|
|
|
2022-10-26 23:53:17 +02:00
|
|
|
uword pointer = $1000
|
|
|
|
uword index
|
|
|
|
foou[1] = 42
|
|
|
|
pointer[$40] = 24
|
|
|
|
pointer[$40] = foou[1]+10
|
|
|
|
txt.print_ub(@($1040))
|
|
|
|
txt.nl()
|
|
|
|
pointer[index+$100] = foou[1]
|
|
|
|
pointer[index+$1000] = foou[1]+1
|
|
|
|
txt.print_ub(@($1100))
|
|
|
|
txt.nl()
|
|
|
|
txt.print_ub(@($2000))
|
|
|
|
txt.nl()
|
2022-10-19 23:23:49 +02:00
|
|
|
|
2022-10-04 00:47:51 +02:00
|
|
|
|
2022-10-26 23:53:17 +02:00
|
|
|
; foo[0] = -foo[0]
|
|
|
|
; foou[0] = ~foou[0]
|
|
|
|
; foow[0] = -foow[0]
|
|
|
|
; foowu[0] = ~foowu[0]
|
|
|
|
; flt[0] = -flt[0] ; TODO also fix crash when selecting vm target: fpReg1 out of bounds
|
|
|
|
}
|
2022-09-18 16:04:49 +02:00
|
|
|
}
|