1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-30 01:50:10 +00:00
6502bench/SourceGen/SGTestData/Expected/2012-label-localizer_cc65.S
Andy McFadden 2065f4ef9e Attempt to generate segment names for cc65
This worked, sort of.  The problem is that SourceGen will revert to
hex output in certain situations, such as a broken symbolic
reference.  There happens to be one in the ZIPPY example, and it's
on a relative branch.

The goal with the segment stuff is to allow cc65 to treat the
source as relocatable code.  In that context, a relative branch to
an absolute address doesn't make any sense, so the assembler reports
a range error.

We don't currently have a mechanism that guarantees no references
are broken (and no affordance for finding them), so we can't make
this mode the default yet.

Instead, we continue to use the generic config, but generate the
correct set of lines as comments.

(issue #39)
2018-11-18 15:11:29 -08:00

61 lines
1.1 KiB
ArmAsm

.setcpu "65816"
REALLYLONGLABELNAME = $8888 ;that's a long name
; .segment "SEG000"
.org $1000
.a8
.i8
nop
_start: lda @start
lda X_start
lda pastglob
lda @__nopped
@start: nop
@__nopped:
nop
X_start: nop
pastglob:
nop
lda nlocal
nlocal: lda #$11
reach1G: nop
lda reach1G+1
lda @reach2+2
@reach2: nop
reach3G: nop
@_reach4:
nop
lda @_reach4-2
lda $00
beq @L102D
jsr @_reach4
jsr _start
@L102D: lda #$22
lda gtest2
gtest1: nop
lda gtest3
gtest2: nop
gtest3: nop
lda #$33
lda $1041
topglob: nop
lda @L1043
nop
nop
@L1043: nop
lda #$44
globalnm:
jsr @L104A
nop
@L104A: nop
nop
nglobal: nop
globlat: jsr nglobal
bra end
end: nop
EXCESSIVELY_LONG_LABEL:
lda REALLYLONGLABELNAME
rts