1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-09 08:54:40 +00:00
kickc/src/test/ref/declared-memory-var-8.asm
2020-02-23 09:44:36 +01:00

32 lines
512 B
NASM

// Test declaring a variable as "memory", meaning it will be stored in main memory
// Test a fixed main memory address __notssa variable
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
.label SCREEN = $400
.label idx = $1000
__bbegin:
// idx
lda #0
sta idx
jsr main
rts
main: {
ldx #0
__b1:
// SCREEN[i] = idx
lda idx
sta SCREEN,x
// idx +=i
txa
clc
adc idx
sta idx
// for( char i: 0..5 )
inx
cpx #6
bne __b1
// }
rts
}