1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-09 08:54:40 +00:00
kickc/src/test/ref/struct-14.asm

24 lines
516 B
NASM

// Minimal struct with C-Standard behavior - declaration, instantiation and usage
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.const OFFSET_STRUCT_POINT_Y = 1
.label SCREEN = $400
main: {
// points[0].x = 2
lda #2
sta points
// points[0].y = 3
lda #3
sta points+OFFSET_STRUCT_POINT_Y
// SCREEN[0] = points[0].x
lda points
sta SCREEN
// SCREEN[1] = points[0].y
lda points+OFFSET_STRUCT_POINT_Y
sta SCREEN+1
// }
rts
}
points: .fill 2*1, 0