1
0
mirror of https://github.com/fadden/6502bench.git synced 2026-04-22 01:16:42 +00:00

Add jump table formatting

When asked to tag an absolute JMP instruction ($4C) as code, we now
scan forward to see if it's the start of a series of JMPs.  If we
find more than one, we offer the opportunity to tag the entire set
all at once.

A series of unformatted JMPs has been added to 20200-ui-edge-cases
for manual testing.

(issue #22)
This commit is contained in:
Andy McFadden
2025-07-10 16:14:17 -07:00
parent 213f7cc205
commit eb6999b1b0
11 changed files with 208 additions and 22 deletions
Binary file not shown.
+3 -10
View File
@@ -1,8 +1,8 @@
### 6502bench SourceGen dis65 v1.0 ###
{
"_ContentVersion":6,
"FileDataLength":193,
"FileDataCrc32":960553569,
"FileDataLength":222,
"FileDataCrc32":1648676931,
"ProjectProps":{
"CpuName":"6502",
"IncludeUndocumentedInstr":false,
@@ -132,7 +132,7 @@
{
"Offset":53,
"Addr":8704,
"Length":140,
"Length":169,
"PreLabel":"",
"DisallowInward":false,
"DisallowOutward":false,
@@ -197,13 +197,6 @@
"Type":"GlobalAddr",
"LabelAnno":"None"},
"192":{
"Label":"done",
"Value":8843,
"Source":"User",
"Type":"GlobalAddr",
"LabelAnno":"None"},
"163":{
"Label":"bitsy",
"Value":8814,
@@ -64,7 +64,7 @@ next1 lda addr1
bcc bitsy+1
bitsy .byte $2c
lda #$ff
jmp done
jmp _L228B
.word FOO
.word FOO_5
@@ -79,6 +79,22 @@ bitsy .byte $2c
.word zf4
.byte $80
done rts
_L228B nop
jmp _L22A8
.byte $4c
.byte $8b
.text $22,"L9",$22,"L"
.byte $95
.byte $22
.byte $4c
.byte $00
.byte $30
.byte $ea
.text "L9",$22,"L"
.byte $00
.text "1LLLLLL"
_L22A8 rts
.here
@@ -63,7 +63,7 @@ next1 lda addr1
bcc bitsy+1
bitsy !byte $2c
lda #$ff
jmp done
jmp @L228B
!word FOO
!word FOO_5
@@ -78,6 +78,22 @@ bitsy !byte $2c
!word zf4
!byte $80
done rts
@L228B nop
jmp @L22A8
!byte $4c
!byte $8b
!text $22,"L9",$22,"L"
!byte $95
!byte $22
!byte $4c
!byte $00
!byte $30
!byte $ea
!text "L9",$22,"L"
!byte $00
!text "1LLLLLL"
@L22A8 rts
}
@@ -59,7 +59,7 @@ next1: lda addr1
bcc bitsy+1
bitsy: .byte $2c
lda #$ff
jmp done
jmp @L228B
.word FOO
.word FOO_5
@@ -74,5 +74,21 @@ bitsy: .byte $2c
.word zf4
.byte $80
done: rts
@L228B: nop
jmp @L22A8
.byte $4c
.byte $8b
.byte $22,"L9",$22,"L"
.byte $95
.byte $22
.byte $4c
.byte $00
.byte $30
.byte $ea
.byte "L9",$22,"L"
.byte $00
.byte "1LLLLLL"
@L22A8: rts
@@ -58,7 +58,7 @@ next1 lda addr1
bcc bitsy+1
bitsy dfb $2c
lda #$ff
jmp done
jmp :L228B
dw FOO
dw FOO_5
@@ -73,5 +73,21 @@ bitsy dfb $2c
dw zf4
dfb $80
done rts
:L228B nop
jmp :L22A8
dfb $4c
dfb $8b
asc '"L9"L'
dfb $95
dfb $22
dfb $4c
dfb $00
dfb $30
dfb $ea
asc 'L9"L'
dfb $00
asc '1LLLLLL'
:L22A8 rts
@@ -86,7 +86,7 @@ next1
bcc bitsy+1 ;EDIT: set symbol "bitsy"
bitsy bit $ffa9 ;EDIT: set label "bitsy" on BIT instruction
jmp done
jmp next2
; EDIT: format as 16-bit addresses
dw FOO
@@ -102,4 +102,18 @@ bitsy bit $ffa9 ;EDIT: set label "bitsy" on BIT instruction
dw zf4
dfb $80
done rts
next2 nop
; jump table
jmp next3
jmp next2
jmp next1
self jmp self
jmp plataddr
nop
jmp next1
jmp OVERL
jmp $4c4c
jmp $4c4c
next3 rts