1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-07-11 02:28:54 +00:00

Work around Merlin assembler bug

The assembler can't handle "DFB '{'" or "DFB '}'", so just output
those as hex.

Tests added to 2006-operand-formats.
This commit is contained in:
Andy McFadden 2020-03-18 17:45:06 -07:00
parent 5d852e3ea6
commit 547cbb7811
9 changed files with 450 additions and 71 deletions

View File

@ -246,9 +246,15 @@ namespace SourceGen.AsmGen {
case FormatDescriptor.Type.NumericLE:
opcodeStr = sDataOpNames.GetDefineData(length);
operand = RawData.GetWord(data, offset, length, false);
operandStr = PseudoOp.FormatNumericOperand(formatter, Project.SymbolTable,
mLocalizer.LabelMap, dfd, operand, length,
PseudoOp.FormatNumericOpFlags.OmitLabelPrefixSuffix);
if (length == 1 && dfd.IsStringOrCharacter &&
(operand & 0x7f) == '{' || (operand & 0x7f) == '}') {
// Merlin32 can't handle "DFB '{'", so just output hex.
operandStr = formatter.FormatHexValue(operand, length * 2);
} else {
operandStr = PseudoOp.FormatNumericOperand(formatter, Project.SymbolTable,
mLocalizer.LabelMap, dfd, operand, length,
PseudoOp.FormatNumericOpFlags.OmitLabelPrefixSuffix);
}
break;
case FormatDescriptor.Type.NumericBE:
opcodeStr = sDataOpNames.GetDefineBigData(length);

View File

@ -1,135 +1,457 @@
### 6502bench SourceGen dis65 v1.0 ###
{
"_ContentVersion":1,"FileDataLength":133,"FileDataCrc32":-811370049,"ProjectProps":{
"CpuName":"65816","IncludeUndocumentedInstr":false,"EntryFlags":33489103,"AnalysisParams":{
"AnalyzeUncategorizedData":true,"MinCharsForString":4,"SeekNearbyTargets":true},
"PlatformSymbolFileIdentifiers":[],"ExtensionScriptFileIdentifiers":[],"ProjectSyms":{
"_ContentVersion":3,
"FileDataLength":143,
"FileDataCrc32":-2044577818,
"ProjectProps":{
"CpuName":"65816",
"IncludeUndocumentedInstr":false,
"TwoByteBrk":false,
"EntryFlags":33489103,
"AutoLabelStyle":"Simple",
"AnalysisParams":{
"AnalyzeUncategorizedData":true,
"DefaultTextScanMode":"LowHighAscii",
"MinCharsForString":4,
"SeekNearbyTargets":true,
"SmartPlpHandling":true},
"PlatformSymbolFileIdentifiers":[],
"ExtensionScriptFileIdentifiers":[],
"ProjectSyms":{
}},
"AddressMap":[{
"Offset":0,"Addr":4096}],"TypeHints":[{
"Low":0,"High":0,"Hint":"Code"}],"StatusFlagOverrides":{
"Offset":0,
"Addr":4096}],
"TypeHints":[{
"Low":0,
"High":0,
"Hint":"Code"}],
"StatusFlagOverrides":{
},
"Comments":{
},
"LongComments":{
"-2147483647":{
"Text":"Project file was edited for some ASCII operands.","BoxMode":false,"MaxWidth":80}},
"Text":"Project file was edited for some ASCII operands.",
"BoxMode":false,
"MaxWidth":80,
"BackgroundColor":0}},
"Notes":{
},
"UserLabels":{
"63":{
"Label":"skipdata","Value":4159,"Source":"User","Type":"LocalOrGlobalAddr"},
"Label":"skipdata",
"Value":4159,
"Source":"User",
"Type":"LocalOrGlobalAddr",
"LabelAnno":"None"},
"112":{
"Label":"more_ascii","Value":4208,"Source":"User","Type":"LocalOrGlobalAddr"}},
"Label":"more_ascii",
"Value":4208,
"Source":"User",
"Type":"LocalOrGlobalAddr",
"LabelAnno":"None"}},
"OperandFormats":{
"4":{
"Length":2,"Format":"NumericLE","SubFormat":"Hex","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Hex",
"SymbolRef":null},
"6":{
"Length":3,"Format":"NumericLE","SubFormat":"Hex","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Hex",
"SymbolRef":null},
"9":{
"Length":4,"Format":"NumericLE","SubFormat":"Hex","SymbolRef":null},
"Length":4,
"Format":"NumericLE",
"SubFormat":"Hex",
"SymbolRef":null},
"13":{
"Length":2,"Format":"NumericLE","SubFormat":"Decimal","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Decimal",
"SymbolRef":null},
"15":{
"Length":3,"Format":"NumericLE","SubFormat":"Decimal","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Decimal",
"SymbolRef":null},
"18":{
"Length":4,"Format":"NumericLE","SubFormat":"Decimal","SymbolRef":null},
"Length":4,
"Format":"NumericLE",
"SubFormat":"Decimal",
"SymbolRef":null},
"22":{
"Length":2,"Format":"NumericLE","SubFormat":"Binary","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Binary",
"SymbolRef":null},
"24":{
"Length":3,"Format":"NumericLE","SubFormat":"Binary","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Binary",
"SymbolRef":null},
"27":{
"Length":4,"Format":"NumericLE","SubFormat":"Binary","SymbolRef":null},
"Length":4,
"Format":"NumericLE",
"SubFormat":"Binary",
"SymbolRef":null},
"33":{
"Length":1,"Format":"NumericLE","SubFormat":"Hex","SymbolRef":null},
"Length":1,
"Format":"NumericLE",
"SubFormat":"Hex",
"SymbolRef":null},
"34":{
"Length":2,"Format":"NumericLE","SubFormat":"Hex","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Hex",
"SymbolRef":null},
"36":{
"Length":3,"Format":"NumericLE","SubFormat":"Hex","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Hex",
"SymbolRef":null},
"39":{
"Length":4,"Format":"NumericLE","SubFormat":"Hex","SymbolRef":null},
"Length":4,
"Format":"NumericLE",
"SubFormat":"Hex",
"SymbolRef":null},
"43":{
"Length":1,"Format":"NumericLE","SubFormat":"Decimal","SymbolRef":null},
"Length":1,
"Format":"NumericLE",
"SubFormat":"Decimal",
"SymbolRef":null},
"44":{
"Length":2,"Format":"NumericLE","SubFormat":"Decimal","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Decimal",
"SymbolRef":null},
"46":{
"Length":3,"Format":"NumericLE","SubFormat":"Decimal","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Decimal",
"SymbolRef":null},
"49":{
"Length":4,"Format":"NumericLE","SubFormat":"Decimal","SymbolRef":null},
"Length":4,
"Format":"NumericLE",
"SubFormat":"Decimal",
"SymbolRef":null},
"53":{
"Length":1,"Format":"NumericLE","SubFormat":"Binary","SymbolRef":null},
"Length":1,
"Format":"NumericLE",
"SubFormat":"Binary",
"SymbolRef":null},
"54":{
"Length":2,"Format":"NumericLE","SubFormat":"Binary","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Binary",
"SymbolRef":null},
"56":{
"Length":3,"Format":"NumericLE","SubFormat":"Binary","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Binary",
"SymbolRef":null},
"59":{
"Length":4,"Format":"NumericLE","SubFormat":"Binary","SymbolRef":null},
"Length":4,
"Format":"NumericLE",
"SubFormat":"Binary",
"SymbolRef":null},
"63":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"65":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"67":{
"Length":3,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"70":{
"Length":4,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":4,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"74":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"76":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"78":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"80":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"82":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"84":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"86":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"88":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"90":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"92":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"94":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"96":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"98":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"100":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"102":{
"Length":3,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"105":{
"Length":3,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"108":{
"Length":3,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"112":{
"Length":1,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":1,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"113":{
"Length":1,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":1,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"114":{
"Length":2,"Format":"NumericLE","SubFormat":"Ascii","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"117":{
"Length":2,"Format":"NumericLE","SubFormat":"Address","SymbolRef":null},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Address",
"SymbolRef":null},
"119":{
"Length":3,"Format":"NumericLE","SubFormat":"Address","SymbolRef":null},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Address",
"SymbolRef":null},
"122":{
"Length":2,"Format":"NumericBE","SubFormat":"Address","SymbolRef":null},
"Length":2,
"Format":"NumericBE",
"SubFormat":"Address",
"SymbolRef":null},
"124":{
"Length":1,"Format":"NumericLE","SubFormat":"Symbol","SymbolRef":{
"Label":"more_ascii","Part":"Low"}},
"Length":1,
"Format":"NumericLE",
"SubFormat":"Symbol",
"SymbolRef":{
"Label":"more_ascii",
"Part":"Low"}},
"125":{
"Length":1,"Format":"NumericLE","SubFormat":"Symbol","SymbolRef":{
"Label":"more_ascii","Part":"High"}},
"Length":1,
"Format":"NumericLE",
"SubFormat":"Symbol",
"SymbolRef":{
"Label":"more_ascii",
"Part":"High"}},
"126":{
"Length":2,"Format":"NumericLE","SubFormat":"Symbol","SymbolRef":{
"Label":"more_ascii","Part":"Low"}},
"Length":2,
"Format":"NumericLE",
"SubFormat":"Symbol",
"SymbolRef":{
"Label":"more_ascii",
"Part":"Low"}},
"128":{
"Length":3,"Format":"NumericLE","SubFormat":"Symbol","SymbolRef":{
"Label":"more_ascii","Part":"Low"}},
"Length":3,
"Format":"NumericLE",
"SubFormat":"Symbol",
"SymbolRef":{
"Label":"more_ascii",
"Part":"Low"}},
"131":{
"Length":2,"Format":"NumericBE","SubFormat":"Symbol","SymbolRef":{
"Label":"more_ascii","Part":"Low"}}}}
"Length":2,
"Format":"NumericBE",
"SubFormat":"Symbol",
"SymbolRef":{
"Label":"more_ascii",
"Part":"Low"}},
"133":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"134":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"135":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"136":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"137":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"Ascii",
"SymbolRef":null},
"138":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"139":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"140":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"141":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null},
"142":{
"Length":1,
"Format":"NumericLE",
"SubFormat":"HighAscii",
"SymbolRef":null}},
"LvTables":{
},
"Visualizations":[],
"VisualizationAnimations":[],
"VisualizationSets":{
}}

View File

@ -71,3 +71,13 @@ _more_ascii .byte 'h'
.word _more_ascii
.long _more_ascii
.byte $10,$70
.byte '['
.byte '{'
.byte '|'
.byte '}'
.byte ','
.byte '[' | $80
.byte '{' | $80
.byte '|' | $80
.byte '}' | $80
.byte ',' | $80

View File

@ -63,3 +63,13 @@ skipdata lda #'h'
dw :more_ascii
adr :more_ascii
ddb :more_ascii
dfb '['
dfb $7b
dfb '|'
dfb $7d
dfb ','
dfb "["
dfb $fb
dfb "|"
dfb $fd
dfb ","

View File

@ -67,3 +67,13 @@ skipdata lda #'h'
!word @more_ascii
!24 @more_ascii
!byte $10,$70
!byte '['
!byte '{'
!byte '|'
!byte '}'
!byte ','
!byte '[' | $80
!byte '{' | $80
!byte '|' | $80
!byte '}' | $80
!byte ',' | $80

View File

@ -68,3 +68,13 @@ skipdata: lda #'h'
.word @more_ascii
.faraddr @more_ascii
.dbyt @more_ascii
.byte '['
.byte '{'
.byte '|'
.byte '}'
.byte ','
.byte '[' | $80
.byte '{' | $80
.byte '|' | $80
.byte '}' | $80
.byte ',' | $80

View File

@ -1,7 +1,7 @@
# 6502bench SourceGen generated linker script for 2006-operand-formats
MEMORY {
MAIN: file=%O, start=%S, size=65536;
# MEM000: file=%O, start=$1000, size=133;
# MEM000: file=%O, start=$1000, size=143;
}
SEGMENTS {
CODE: load=MAIN, type=rw;

View File

@ -84,3 +84,14 @@
adr :ascii
dfb >:ascii,:ascii ;format as big-endian symbol
; Merlin 1.0 has trouble with "DFB '{'".
dfb '['
dfb $7b
dfb $7c
dfb $7d
dfb ','
dfb "["
dfb $fb
dfb $fc
dfb $fd
dfb ","