2019-02-17 23:12:29 +00:00
|
|
|
// Results in infinite compile loop as the compiler keeps trying to remove the same (empty) alias
|
2020-12-21 07:57:41 +00:00
|
|
|
// Commodore 64 PRG executable file
|
|
|
|
.file [name="infloop-error.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
|
2018-10-17 21:00:54 +00:00
|
|
|
:BasicUpstart(main)
|
|
|
|
.label SCREEN = $400
|
2020-12-21 07:57:41 +00:00
|
|
|
.segment Code
|
2018-10-17 21:00:54 +00:00
|
|
|
main: {
|
|
|
|
ldy #0
|
|
|
|
ldx #$ff
|
|
|
|
tya
|
2019-09-29 21:13:37 +00:00
|
|
|
__b2:
|
2020-02-23 08:44:36 +00:00
|
|
|
// pos++;
|
2018-10-17 21:00:54 +00:00
|
|
|
clc
|
|
|
|
adc #1
|
2020-02-23 08:44:36 +00:00
|
|
|
// if(pos<min)
|
2019-08-07 19:00:19 +00:00
|
|
|
stx.z $ff
|
|
|
|
cmp.z $ff
|
2019-09-29 21:13:37 +00:00
|
|
|
bcs __b3
|
2018-10-17 21:00:54 +00:00
|
|
|
tax
|
2019-09-29 21:13:37 +00:00
|
|
|
__b3:
|
2020-02-23 08:44:36 +00:00
|
|
|
// if(pos>max)
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z $ff
|
|
|
|
cpy.z $ff
|
2019-09-29 21:13:37 +00:00
|
|
|
bcs __b4
|
2018-10-17 21:00:54 +00:00
|
|
|
tay
|
2019-09-29 21:13:37 +00:00
|
|
|
__b4:
|
2020-02-23 08:44:36 +00:00
|
|
|
// SCREEN[0] = min
|
2018-10-17 21:00:54 +00:00
|
|
|
stx SCREEN
|
2020-02-23 08:44:36 +00:00
|
|
|
// SCREEN[1] = max
|
2018-10-17 21:00:54 +00:00
|
|
|
sty SCREEN+1
|
2020-02-23 08:44:36 +00:00
|
|
|
// SCREEN[2] = pos
|
2018-10-17 21:00:54 +00:00
|
|
|
sta SCREEN+2
|
2019-09-29 21:13:37 +00:00
|
|
|
jmp __b2
|
2018-10-17 21:00:54 +00:00
|
|
|
}
|