1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-30 09:57:11 +00:00

Working on classic unions. #197

This commit is contained in:
jespergravgaard 2021-07-27 22:43:06 +02:00
parent ea70b1f2e3
commit cf44674bee

21
src/test/ref/union-7.sym Normal file
View File

@ -0,0 +1,21 @@
constant byte* const SCREEN = (byte*) 1024
constant byte SIZEOF_UNION_DATA = 2
union Data data1 loadstore mem[2] = { b: $12 }
union Data data2 loadstore mem[2] = { b: $34 }
byte idx
byte idx#13 reg byte x 8.0
byte idx#14 reg byte x 3.25
byte idx#3 reg byte x 16.5
byte idx#4 reg byte x 16.5
void main()
void print(union Data print::data)
byte~ print::$0 reg byte a 22.0
union Data print::data loadstore zp[2]:2
reg byte x [ idx#13 idx#14 ]
reg byte a [ print::$0 ]
reg byte x [ idx#3 ]
reg byte x [ idx#4 ]
mem[2] [ data1 ]
mem[2] [ data2 ]
zp[2]:2 [ print::data ]