1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-16 21:07:56 +00:00
kickc/src/test/ref/inline-word.asm

43 lines
790 B
NASM
Raw Normal View History

// Commodore 64 PRG executable file
.file [name="inline-word.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.label SCREEN = $400
.segment Code
main: {
.label w = 3
.label h = 2
lda #0
sta.z h
2019-02-17 23:12:29 +00:00
// constant array
__b1:
ldx #4
__b2:
// word w = { his[h], l }
ldy.z h
lda his,y
sta.z w+1
stx.z w
2020-02-23 08:44:36 +00:00
// *sc = '*'
lda #'*'
ldy #0
sta (w),y
2020-02-23 08:44:36 +00:00
// for (byte l: 4..7)
inx
cpx #8
bne __b2
2020-02-23 08:44:36 +00:00
// for( byte h: 0..2)
inc.z h
lda #3
cmp.z h
bne __b1
2020-02-23 08:44:36 +00:00
// }
rts
.segment Data
his: .byte >SCREEN, >SCREEN+$100, >SCREEN+$200
}