mirror of
https://github.com/fadden/6502bench.git
synced 2025-01-02 18:30:41 +00:00
Add a blank line between constants and addresses
In the assembler output, add a blank line between the constants and addresses in the long list of equates. The earlier change that corrected the BIT instruction caused test 2009-branches-and-banks to fail, because it was relying on the idea that BIT made the carry flag indeterminate. Changing a BCC to a BVS restored the desired behavior.
This commit is contained in:
parent
4c43b4063a
commit
9d5f8f8049
@ -148,12 +148,19 @@ namespace SourceGen.AsmGen {
|
||||
gen.OutputAsmConfig();
|
||||
|
||||
// Format symbols.
|
||||
bool prevConst = false;
|
||||
foreach (DefSymbol defSym in proj.ActiveDefSymbolList) {
|
||||
if (prevConst && !defSym.IsConstant) {
|
||||
// Output a blank line between the constants and the address equates.
|
||||
gen.OutputLine(string.Empty);
|
||||
}
|
||||
// Use an operand length of 1 so values are shown as concisely as possible.
|
||||
string valueStr = PseudoOp.FormatNumericOperand(formatter, proj.SymbolTable,
|
||||
gen.Localizer.LabelMap, defSym.DataDescriptor, defSym.Value, 1,
|
||||
PseudoOp.FormatNumericOpFlags.None);
|
||||
gen.OutputEquDirective(defSym.Label, valueStr, defSym.Comment);
|
||||
|
||||
prevConst = defSym.IsConstant;
|
||||
}
|
||||
|
||||
// If there was at least one symbol, output a blank line.
|
||||
|
Binary file not shown.
@ -1,8 +1,8 @@
|
||||
### 6502bench SourceGen dis65 v1.0 ###
|
||||
{
|
||||
"_ContentVersion":1,"FileDataLength":119,"FileDataCrc32":934960724,"ProjectProps":{
|
||||
"CpuName":"65816","IncludeUndocumentedInstr":false,"EntryFlags":33489103,"AnalysisParams":{
|
||||
"AnalyzeUncategorizedData":true,"MinCharsForString":4,"SeekNearbyTargets":true},
|
||||
"_ContentVersion":2,"FileDataLength":119,"FileDataCrc32":-1095650494,"ProjectProps":{
|
||||
"CpuName":"65816","IncludeUndocumentedInstr":false,"TwoByteBrk":false,"EntryFlags":33489103,"AutoLabelStyle":"Simple","AnalysisParams":{
|
||||
"AnalyzeUncategorizedData":true,"DefaultTextScanMode":"LowHighAscii","MinCharsForString":4,"SeekNearbyTargets":true,"SmartPlpHandling":true},
|
||||
"PlatformSymbolFileIdentifiers":["PROJ:2009-branches-and-banks.sym65"],"ExtensionScriptFileIdentifiers":[],"ProjectSyms":{
|
||||
}},
|
||||
"AddressMap":[{
|
||||
@ -54,4 +54,6 @@
|
||||
"Label":"j2","Part":"Low"}},
|
||||
"111":{
|
||||
"Length":3,"Format":"NumericLE","SubFormat":"Symbol","SymbolRef":{
|
||||
"Label":"j2","Part":"Low"}}}}
|
||||
"Label":"j2","Part":"Low"}}},
|
||||
"LvTables":{
|
||||
}}
|
||||
|
@ -8,6 +8,7 @@ absl = $1029
|
||||
absh = $feed
|
||||
biggie = $123456
|
||||
thirty2 = $12345678 ;32-bit constant test
|
||||
|
||||
plataddr = $3000 ;address only in platform file
|
||||
projalsa = $3200 ;same val as projalso
|
||||
|
||||
|
@ -5,6 +5,7 @@ absl equ $1029
|
||||
absh equ $feed
|
||||
biggie equ $123456
|
||||
thirty2 equ $12345678 ;32-bit constant test
|
||||
|
||||
plataddr equ $3000 ;address only in platform file
|
||||
projalsa equ $3200 ;same val as projalso
|
||||
|
||||
|
@ -6,6 +6,7 @@ absl = $1029
|
||||
absh = $feed
|
||||
biggie = $123456
|
||||
thirty2 = $12345678 ;32-bit constant test
|
||||
|
||||
plataddr = $3000 ;address only in platform file
|
||||
projalsa = $3200 ;same val as projalso
|
||||
|
||||
|
@ -16,7 +16,7 @@ L0003 lda L0000
|
||||
bne LFFC3
|
||||
bmi $ffc3
|
||||
per LFFC3
|
||||
bcc L0016
|
||||
bvs L0016
|
||||
brl L0080
|
||||
|
||||
lodat .byte $00
|
||||
|
@ -13,7 +13,7 @@ L0003 lda L0000
|
||||
dfb $d0,$ba
|
||||
dfb $30,$b8
|
||||
dfb $62,$b5,$ff
|
||||
bcc L0016
|
||||
bvs L0016
|
||||
brl L0080
|
||||
|
||||
lodat dfb $00
|
||||
|
@ -1,6 +1,6 @@
|
||||
;ACME can't handle 65816 code that lives outside bank zero
|
||||
* = $1000
|
||||
!hex 18fbe2304c00002c0000a500a503d0ba30b862b5ff9006826d00000102a51482
|
||||
!hex 18fbe2304c00002c0000a500a503d0ba30b862b5ff7006826d00000102a51482
|
||||
!hex a5ff2c80005c0000442cc0ff823d00cf000044af000044ad0000a50030f562b2
|
||||
!hex ffd0b082a9ff1700170044cfc0ff44f005303c8239005c0020002c0020f41700
|
||||
!hex f44400d003dc1300ea201220201520200f202256341260
|
||||
|
@ -18,7 +18,7 @@ L0003: lda L0000
|
||||
.byte $d0,$ba
|
||||
.byte $30,$b8
|
||||
.byte $62,$b5,$ff
|
||||
bcc L0016
|
||||
bvs L0016
|
||||
brl L0080
|
||||
|
||||
lodat: .byte $00
|
||||
|
@ -3,6 +3,7 @@
|
||||
.enc sg_ascii
|
||||
.cdef $20,$7e,$20
|
||||
CONST_ZERO = $f0 ;project const
|
||||
|
||||
PROJ_ZERO = $00 ;project addr
|
||||
PROJ_ONE = $01 ;project addr
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
;Edited to have duplicate labels (PROJ_ZERO, DPCODE).
|
||||
CONST_ZERO equ $f0 ;project const
|
||||
|
||||
PROJ_ZERO equ $00 ;project addr
|
||||
PROJ_ONE equ $01 ;project addr
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
;Edited to have duplicate labels (PROJ_ZERO, DPCODE).
|
||||
!cpu 65816
|
||||
CONST_ZERO = $f0 ;project const
|
||||
|
||||
PROJ_ZERO = $00 ;project addr
|
||||
PROJ_ONE = $01 ;project addr
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
;Edited to have duplicate labels (PROJ_ZERO, DPCODE).
|
||||
.setcpu "65816"
|
||||
CONST_ZERO = $f0 ;project const
|
||||
|
||||
PROJ_ZERO = $00 ;project addr
|
||||
PROJ_ONE = $01 ;project addr
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
.cpu "6502"
|
||||
FatConst = $4000
|
||||
|
||||
OverVar = $40
|
||||
CodeWrap = $0f00 ;encases program
|
||||
SameName1 = $2000
|
||||
|
@ -1,4 +1,5 @@
|
||||
FatConst equ $4000
|
||||
|
||||
OverVar equ $40
|
||||
CodeWrap equ $0f00 ;encases program
|
||||
SameName1 equ $2000
|
||||
|
@ -1,5 +1,6 @@
|
||||
!cpu 6502
|
||||
FatConst = $4000
|
||||
|
||||
OverVar = $40
|
||||
CodeWrap = $0f00 ;encases program
|
||||
SameName1 = $2000
|
||||
|
@ -1,5 +1,6 @@
|
||||
.setcpu "6502"
|
||||
FatConst = $4000
|
||||
|
||||
OverVar = $40
|
||||
CodeWrap = $0f00 ;encases program
|
||||
SameName1 = $2000
|
||||
|
@ -28,7 +28,7 @@ low: lda zero
|
||||
bne low-$40 ;reference symbol
|
||||
bmi low-$40 ;EDIT: format as hex
|
||||
per low-$40
|
||||
bcc more
|
||||
bvs more
|
||||
brl more1
|
||||
lodat: .byte $00,$01,$02 ;EDIT: set label
|
||||
more: lda more-2
|
||||
|
8
SourceGen/SGTestData/Source/2009-branches-and-banks.cfg
Normal file
8
SourceGen/SGTestData/Source/2009-branches-and-banks.cfg
Normal file
@ -0,0 +1,8 @@
|
||||
MEMORY {
|
||||
MAIN: file=%O, start=%S, size=65536;
|
||||
}
|
||||
SEGMENTS {
|
||||
CODE: load=MAIN, type=rw;
|
||||
}
|
||||
FEATURES {}
|
||||
SYMBOLS {}
|
Loading…
Reference in New Issue
Block a user