However, the scope works the opposite way to Celius's example.
This won't compile:
Code: Select all
bne ++
beq + ; Error: undefined label
++ lda #1
jmp +++
+ lda #2 ; Warning: unused label
+++ rts
Code: Select all
bne +
beq ++
+ lda #1
jmp +++
++ lda #2
+++ rts
Thus the length of the plus or minus sequence is indicative of how far the label is from its use. I totally love this syntax (and hate the way ca65 does it, but I work with it).
I'm not sure whether xa65 allows it, but more short labels can also be defined in a single line. Example (from my Simon's Quest automatic disassembly):
Code: Select all
PlotAction01_Continues:
$8336 A4 19: ldy CurrentPlotAction_StateWithin
$8338 D0 07: bne ++ ; $8341
$833A C6 2A: dec TimeRelated2A
$833C D0 02: bne + ; $8340 -> rts
$833E E6 19: inc CurrentPlotAction_StateWithin
+ - $8340 60: rts
++ $8341 E6 FD: inc PPUscrollingPositionLo
$8343 A5 FD: lda PPUscrollingPositionLo
$8345 D0 F9: bne - ; $8340 -> rts
$8347 A5 FF: lda PPUdesiredRegister2000
$8349 49 01: eor #$01
$834B 85 FF: sta PPUdesiredRegister2000
$834D A9 B4: lda #$B4
$834F 85 2A: sta TimeRelated2A
$8351 A9 00: lda #$00
$8353 85 19: sta CurrentPlotAction_StateWithin
$8355 60: rts