2020-12-21 07:57:41 +00:00
|
|
|
// 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
|
2017-12-25 22:27:54 +00:00
|
|
|
:BasicUpstart(main)
|
2018-01-31 20:27:22 +00:00
|
|
|
.label SCREEN = $400
|
2020-12-21 07:57:41 +00:00
|
|
|
.segment Code
|
2017-12-25 22:27:54 +00:00
|
|
|
main: {
|
|
|
|
.label w = 3
|
2017-12-26 16:24:30 +00:00
|
|
|
.label h = 2
|
|
|
|
lda #0
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z h
|
2019-02-17 23:12:29 +00:00
|
|
|
// constant array
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2017-12-26 16:24:30 +00:00
|
|
|
ldx #4
|
2019-09-29 21:13:37 +00:00
|
|
|
__b2:
|
2021-05-02 12:28:03 +00:00
|
|
|
// word w = { his[h], l }
|
2019-08-07 19:00:19 +00:00
|
|
|
ldy.z h
|
2017-12-26 16:24:30 +00:00
|
|
|
lda his,y
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z w+1
|
|
|
|
stx.z w
|
2020-02-23 08:44:36 +00:00
|
|
|
// *sc = '*'
|
2017-12-25 22:27:54 +00:00
|
|
|
lda #'*'
|
2017-12-30 20:59:23 +00:00
|
|
|
ldy #0
|
2019-05-30 19:38:12 +00:00
|
|
|
sta (w),y
|
2020-02-23 08:44:36 +00:00
|
|
|
// for (byte l: 4..7)
|
2017-12-25 22:27:54 +00:00
|
|
|
inx
|
2017-12-26 16:24:30 +00:00
|
|
|
cpx #8
|
2019-09-29 21:13:37 +00:00
|
|
|
bne __b2
|
2020-02-23 08:44:36 +00:00
|
|
|
// for( byte h: 0..2)
|
2019-08-07 19:00:19 +00:00
|
|
|
inc.z h
|
2019-03-26 22:49:44 +00:00
|
|
|
lda #3
|
2019-08-07 19:00:19 +00:00
|
|
|
cmp.z h
|
2019-09-29 21:13:37 +00:00
|
|
|
bne __b1
|
2020-02-23 08:44:36 +00:00
|
|
|
// }
|
2017-12-25 22:27:54 +00:00
|
|
|
rts
|
2020-12-21 07:57:41 +00:00
|
|
|
.segment Data
|
2017-12-26 16:24:30 +00:00
|
|
|
his: .byte >SCREEN, >SCREEN+$100, >SCREEN+$200
|
2017-12-25 22:27:54 +00:00
|
|
|
}
|