1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-06-29 09:29:31 +00:00
kickc/src/test/ref/problem-struct-inline-parameter.asm

28 lines
545 B
NASM

// Illustrates problem with passing an inline struct value as a parameter
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label SCREEN = $400
main: {
// print('c', (struct format){ '-', '-' } )
jsr print
// }
rts
}
print: {
.const c = 'c'
.const fmt_prefix = '-'
.const fmt_postfix = '-'
// SCREEN[idx++] = fmt.prefix
lda #fmt_prefix
sta SCREEN
// SCREEN[idx++] = c
lda #c
sta SCREEN+1
// SCREEN[idx++] = fmt.postfix
lda #fmt_postfix
sta SCREEN+2
// }
rts
}