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

Optionally treat BRKs as two-byte instructions

Early data sheets listed BRK as one byte, but RTI after a BRK skips
the following byte, effectively making BRK a 2-byte instruction.
Sometimes, such as when diassembling Apple /// SOS code, it's handy
to treat it that way explicitly.

This change makes two-byte BRKs optional, controlled by a checkbox
in the project settings.  In the system definitions it defaults to
true for Apple ///, false for all others.

ACME doesn't allow BRK to have an arg, and cc65 only allows it for
65816 code (?), so it's emitted as a hex blob for those assemblers.
Anyone wishing to target those assemblers should stick to 1-byte mode.

Extension scripts have to switch between formatting one byte of
inline data and formatting an instruction with a one-byte operand.
A helper function has been added to the plugin Util class.

To get some regression test coverage, 2022-extension-scripts has
been configured to use two-byte BRK.

Also, added/corrected some SOS constants.

See also issue #44.
This commit is contained in:
Andy McFadden
2019-10-09 14:55:56 -07:00
parent b8e11215fa
commit dfd5bcab1b
25 changed files with 127 additions and 58 deletions
@@ -28,11 +28,9 @@ PrintInlineDciString = $013000
jsr L10AB
jsr L110F
jsr L1108
brk
.byte $01
brk #$01
.word data01
brk
.byte $02
brk #$02
.word data02
rts
@@ -80,9 +78,7 @@ L10AB jsr PrintInlineNullString
L1108 jsl PrintInlineL2String
asl a
brk
.byte $60
brk #$60
L110F jsr PrintInlineNullString
adc $6e
@@ -21,11 +21,9 @@ PrintInlineDciString equ $013000
jsr L10AB
jsr L110F
jsr L1108
brk
dfb $01
brk $01
dw data01
brk
dfb $02
brk $02
dw data02
rts
@@ -71,9 +69,7 @@ L10AB jsr PrintInlineNullString
L1108 jsl PrintInlineL2String
asl A
brk
dfb $60
brk $60
L110F jsr PrintInlineNullString
adc $6e
@@ -24,11 +24,9 @@ PrintInlineDciString = $013000
jsr L10AB
jsr L110F
jsr L1108
brk
!byte $01
!byte $00,$01
!word data01
brk
!byte $02
!byte $00,$02
!word data02
rts
@@ -76,9 +74,7 @@ L10AB jsr PrintInlineNullString
L1108 jsl PrintInlineL2String
asl
brk
!byte $60
!byte $00,$60
L110F jsr PrintInlineNullString
adc $6e
@@ -25,11 +25,9 @@ PrintInlineDciString = $013000
jsr L10AB
jsr L110F
jsr L1108
brk
.byte $01
.byte $00,$01
.word data01
brk
.byte $02
.byte $00,$02
.word data02
rts
@@ -81,9 +79,7 @@ L10AB: jsr PrintInlineNullString
L1108: jsl PrintInlineL2String
asl A
brk
.byte $60
.byte $00,$60
L110F: jsr PrintInlineNullString
adc $6e