From d0d387b973068da846a71e43bdfe076c61d7af40 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sat, 6 Jun 2020 17:06:31 -0700 Subject: [PATCH] Regression test rework, part 3 Add a 6502-only version of the 20032-labels-and-symbols test. The 65816 version could get away with just the 65816-specific stuff, but there's no real need to modify it. (The next time I update it I may remove the duplicate label since that requires hand-editing.) --- SourceGen/SGTestData/20030-labels-and-symbols | Bin 0 -> 452 bytes .../SGTestData/20030-labels-and-symbols.dis65 | 613 ++++++++++++++++++ .../SGTestData/20030-labels-and-symbols.sym65 | 2 +- .../20030-labels-and-symbols_64tass.S | 114 ++++ .../20030-labels-and-symbols_Merlin32.S | 107 +++ .../Expected/20030-labels-and-symbols_acme.S | 111 ++++ .../Expected/20030-labels-and-symbols_cc65.S | 113 ++++ .../20030-labels-and-symbols_cc65.cfg | 13 + .../Source/20030-labels-and-symbols.S | 134 ++++ 9 files changed, 1206 insertions(+), 1 deletion(-) create mode 100644 SourceGen/SGTestData/20030-labels-and-symbols create mode 100644 SourceGen/SGTestData/20030-labels-and-symbols.dis65 create mode 100644 SourceGen/SGTestData/Expected/20030-labels-and-symbols_64tass.S create mode 100644 SourceGen/SGTestData/Expected/20030-labels-and-symbols_Merlin32.S create mode 100644 SourceGen/SGTestData/Expected/20030-labels-and-symbols_acme.S create mode 100644 SourceGen/SGTestData/Expected/20030-labels-and-symbols_cc65.S create mode 100644 SourceGen/SGTestData/Expected/20030-labels-and-symbols_cc65.cfg create mode 100644 SourceGen/SGTestData/Source/20030-labels-and-symbols.S diff --git a/SourceGen/SGTestData/20030-labels-and-symbols b/SourceGen/SGTestData/20030-labels-and-symbols new file mode 100644 index 0000000000000000000000000000000000000000..29a9d0a2d10ac9c75a2e7fd2fc4f0a3abf3d41cb GIT binary patch literal 452 zcmcJHJx;?w5QT>W5QYR=G-#1fkP-#B0#3CB1qX}_>~&%%U_YGwbhgRt7UM50 z&78+ls3JlY05azwE0tzE#-N#>%hCdZ1MnCy01h~vPAxPntXtTyu*n+*p)yhhX#sf| zc?J0|LyJgDNXtkoNUKO|NHyfG`IFPL^NY)?>zmuV`-jJ;=l{+-1CdZJpF$=3l;~K< zex0^QxZm9Rq$VXvXwoVNvM1t*^uW*aAo#Nzj>#Vm13xZyMJb;onnEFi oI?+xJ_D7<#N9|Z0O6sX2+8ss1gw#P0|2#b&Q&;tqx@fe%0m8?!F8}}l literal 0 HcmV?d00001 diff --git a/SourceGen/SGTestData/20030-labels-and-symbols.dis65 b/SourceGen/SGTestData/20030-labels-and-symbols.dis65 new file mode 100644 index 0000000..5d44e18 --- /dev/null +++ b/SourceGen/SGTestData/20030-labels-and-symbols.dis65 @@ -0,0 +1,613 @@ +### 6502bench SourceGen dis65 v1.0 ### +{ +"_ContentVersion":3, +"FileDataLength":452, +"FileDataCrc32":-1349239236, +"ProjectProps":{ +"CpuName":"6502", +"IncludeUndocumentedInstr":false, +"TwoByteBrk":false, +"EntryFlags":32702671, +"AutoLabelStyle":"Simple", +"AnalysisParams":{ +"AnalyzeUncategorizedData":true, +"DefaultTextScanMode":"LowHighAscii", +"MinCharsForString":4, +"SeekNearbyTargets":true, +"SmartPlpHandling":true}, + +"PlatformSymbolFileIdentifiers":["PROJ:20030-labels-and-symbols.sym65", +"RT:TestData/TestSyms.sym65"], +"ExtensionScriptFileIdentifiers":[], +"ProjectSyms":{ +"BMI":{ +"DataDescriptor":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Hex", +"SymbolRef":null}, + +"Comment":"opcode mnemonic", +"HasWidth":false, +"Direction":"ReadWrite", +"MultiMask":null, +"Label":"BMI", +"Value":48, +"Source":"Project", +"Type":"Constant", +"LabelAnno":"None"}, + +"nextchunk":{ +"DataDescriptor":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Decimal", +"SymbolRef":null}, + +"Comment":"should be replaced by user label", +"HasWidth":false, +"Direction":"ReadWrite", +"MultiMask":null, +"Label":"nextchunk", +"Value":50, +"Source":"Project", +"Type":"ExternalAddr", +"LabelAnno":"None"}, + +"projalsa":{ +"DataDescriptor":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Hex", +"SymbolRef":null}, + +"Comment":"same val as projalso", +"HasWidth":false, +"Direction":"ReadWrite", +"MultiMask":null, +"Label":"projalsa", +"Value":12800, +"Source":"Project", +"Type":"ExternalAddr", +"LabelAnno":"None"}, + +"projalsz":{ +"DataDescriptor":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Hex", +"SymbolRef":null}, + +"Comment":"same val as projalso", +"HasWidth":false, +"Direction":"ReadWrite", +"MultiMask":null, +"Label":"projalsz", +"Value":12800, +"Source":"Project", +"Type":"ExternalAddr", +"LabelAnno":"None"}, + +"projover":{ +"DataDescriptor":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Hex", +"SymbolRef":null}, + +"Comment":"replaces platform symbol", +"HasWidth":false, +"Direction":"ReadWrite", +"MultiMask":null, +"Label":"projover", +"Value":16384, +"Source":"Project", +"Type":"ExternalAddr", +"LabelAnno":"None"}}}, + +"AddressMap":[{ +"Offset":0, +"Addr":9029}, + +{ +"Offset":97, +"Addr":4096}], +"TypeHints":[{ +"Low":0, +"High":0, +"Hint":"Code"}], +"StatusFlagOverrides":{ +}, + +"Comments":{ +"169":"bulky", +"281":"stringy"}, + +"LongComments":{ +"-2147483647":{ +"Text":"Project was edited to add a label in the middle of a dense hex region, and add a duplicate label.", +"BoxMode":false, +"MaxWidth":80, +"BackgroundColor":0}}, + +"Notes":{ +}, + +"UserLabels":{ +"0":{ +"Label":"start", +"Value":9029, +"Source":"User", +"Type":"GlobalAddr", +"LabelAnno":"None"}, + +"98":{ +"Label":"L1000", +"Value":4097, +"Source":"User", +"Type":"LocalOrGlobalAddr", +"LabelAnno":"None"}, + +"99":{ +"Label":"L1000_0", +"Value":4098, +"Source":"User", +"Type":"LocalOrGlobalAddr", +"LabelAnno":"None"}, + +"100":{ +"Label":"l1000", +"Value":4099, +"Source":"User", +"Type":"LocalOrGlobalAddr", +"LabelAnno":"None"}, + +"145":{ +"Label":"calls", +"Value":4144, +"Source":"User", +"Type":"GlobalAddr", +"LabelAnno":"None"}, + +"148":{ +"Label":"calls", +"Value":4144, +"Source":"User", +"Type":"GlobalAddr", +"LabelAnno":"None"}, + +"149":{ +"Label":"badmid", +"Value":4144, +"Source":"User", +"Type":"GlobalAddr", +"LabelAnno":"None"}, + +"179":{ +"Label":"badmidi", +"Value":4144, +"Source":"User", +"Type":"GlobalAddr", +"LabelAnno":"None"}, + +"116":{ +"Label":"targ", +"Value":4115, +"Source":"User", +"Type":"GlobalAddr", +"LabelAnno":"None"}}, + +"OperandFormats":{ +"0":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"zip", +"Part":"Low"}}, + +"2":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"zip", +"Part":"Low"}}, + +"4":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"zip", +"Part":"Low"}}, + +"6":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"8":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"High"}}, + +"10":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"12":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"High"}}, + +"14":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absl", +"Part":"Low"}}, + +"16":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absl", +"Part":"High"}}, + +"18":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absl", +"Part":"Low"}}, + +"20":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absl", +"Part":"High"}}, + +"22":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"Low"}}, + +"24":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"High"}}, + +"26":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"zip", +"Part":"Low"}}, + +"28":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"zip", +"Part":"Low"}}, + +"31":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"34":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"37":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"Low"}}, + +"40":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"Low"}}, + +"46":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"zip", +"Part":"Low"}}, + +"47":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"48":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"High"}}, + +"49":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"Low"}}, + +"50":{ +"Length":1, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"High"}}, + +"51":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"zip", +"Part":"Low"}}, + +"53":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absl", +"Part":"Low"}}, + +"55":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absl", +"Part":"High"}}, + +"57":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absl", +"Part":"Low"}}, + +"59":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absl", +"Part":"High"}}, + +"61":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"63":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"High"}}, + +"65":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"67":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"High"}}, + +"69":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"Low"}}, + +"71":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"High"}}, + +"73":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"Low"}}, + +"75":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"High"}}, + +"77":{ +"Length":2, +"Format":"NumericBE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"79":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"zip", +"Part":"Low"}}, + +"82":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"Low"}}, + +"85":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"absh", +"Part":"High"}}, + +"88":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"Low"}}, + +"91":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"start", +"Part":"High"}}, + +"118":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"targ", +"Part":"Low"}}, + +"124":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"targ", +"Part":"Low"}}, + +"127":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"targ", +"Part":"Low"}}, + +"133":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"targ", +"Part":"Low"}}, + +"136":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"targ", +"Part":"Low"}}, + +"142":{ +"Length":3, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"targ", +"Part":"Low"}}, + +"169":{ +"Length":112, +"Format":"Dense", +"SubFormat":"None", +"SymbolRef":null}, + +"449":{ +"Length":2, +"Format":"NumericLE", +"SubFormat":"Symbol", +"SymbolRef":{ +"Label":"BMI", +"Part":"Low"}}}, + +"LvTables":{ +}, + +"Visualizations":[], +"VisualizationAnimations":[], +"VisualizationSets":{ +}} diff --git a/SourceGen/SGTestData/20030-labels-and-symbols.sym65 b/SourceGen/SGTestData/20030-labels-and-symbols.sym65 index 0edfb71..6f7b028 100644 --- a/SourceGen/SGTestData/20030-labels-and-symbols.sym65 +++ b/SourceGen/SGTestData/20030-labels-and-symbols.sym65 @@ -1,7 +1,7 @@ ; Copyright 2018 faddenSoft. All Rights Reserved. ; See the LICENSE.txt file for distribution terms (Apache 2.0). -*SYNOPSIS Symbols for test 2007-labels-and-symbols +*SYNOPSIS Symbols for test 2003x-labels-and-symbols zip = $cd absl = $1029 diff --git a/SourceGen/SGTestData/Expected/20030-labels-and-symbols_64tass.S b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_64tass.S new file mode 100644 index 0000000..6933263 --- /dev/null +++ b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_64tass.S @@ -0,0 +1,114 @@ +;Project was edited to add a label in the middle of a dense hex region, and add +;a duplicate label. + .cpu "6502" + .enc sg_ascii + .cdef $20,$7e,$20 +BMI1 = $30 ;opcode mnemonic +zip = $cd +absl = $1029 +absh = $feed + +plataddr = $3000 ;address only in platform file +projalsa = $3200 ;same val as projalso + +* = $2345 +start lda #zip + lda #zip+16 + lda #zip-192 + lda #absh + lda #absh)+1 + lda #absl + lda #absl)-1 + lda #start + lda zip+1 + lda @wzip+1 + lda absh-1 + lda absh+1 + lda start+1 + lda start-1 + jmp _L23A3 + + .byte zip + .byte absh + .byte start + .word zip + .word absl + .word 0+(absl >> 8) + .word absl-$1000 + .word 0+(absl >> 8)-16 + .word absh + .word 0+(absh >> 8) + .word absh-$f000 + .word 0+(absh >> 8)+16 + .word start + .word 0+(start >> 8) + .word start+1 + .word 0+(start >> 8) + .byte $fe,$ed + .long zip + .long absh + .long 0+(absh >> 8) + .long start + .long 0+(start >> 8) + +_L23A3 jmp _L1000_1 + + .logical $1000 +_L1000_1 nop +_L1000 nop +_L1000_0 nop +_l1000 lda plataddr + lda $3100 + lda projalsa + lda $3300 + jmp calls + + nop +targ nop + nop +L1015 jsr targ-1 + jsr targ + jsr targ+1 +L101E jmp targ-1 + +L1021 jmp targ + +L1024 jmp targ+1 + +L1027 jmp targ-1 + +L102A jmp targ + +L102D jmp targ+1 + +calls jsr L1015 + jsr L101E + jsr L1021 + jsr L1024 + jsr L1027 + jsr L102A + jsr L102D + jmp L1160 + + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f ;bulky + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .text "This is a long string. Put a label and comment on it to confir" ;stringy + .text "m that the label and comment only appear on the first line. T" + .text "he quick brown fox jumps over the lazy dogs." + +L1160 adc #BMI1 + rts + + .here diff --git a/SourceGen/SGTestData/Expected/20030-labels-and-symbols_Merlin32.S b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_Merlin32.S new file mode 100644 index 0000000..a500d5a --- /dev/null +++ b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_Merlin32.S @@ -0,0 +1,107 @@ +;Project was edited to add a label in the middle of a dense hex region, and add +;a duplicate label. +BMI equ $30 ;opcode mnemonic +zip equ $cd +absl equ $1029 +absh equ $feed + +plataddr equ $3000 ;address only in platform file +projalsa equ $3200 ;same val as projalso + + org $2345 +start lda #zip + lda #zip+16 + lda #zip+64 + lda #absh + lda #absh+$100 + lda #absl + lda #absl-$100 + lda #start + lda zip+1 + lda: zip+1 + lda absh-1 + lda absh+1 + lda start+1 + lda start-1 + jmp :L23A3 + + dfb zip + dfb absh + dfb start + dw zip + dw absl + dw >absl + dw absl-$1000 + dw >absl-$1000 + dw absh + dw >absh + dw absh+$1000 + dw >absh+$1000 + dw start + dw >start + dw start+1 + dw >start + ddb absh + adr zip + adr absh + adr >absh + adr start + adr >start + +:L23A3 jmp :L1000_1 + + org $1000 +:L1000_1 nop +:L1000 nop +:L1000_0 nop +:l1000 lda plataddr + lda $3100 + lda projalsa + lda $3300 + jmp calls + + nop +targ nop + nop +L1015 jsr targ-1 + jsr targ + jsr targ+1 +L101E jmp targ-1 + +L1021 jmp targ + +L1024 jmp targ+1 + +L1027 jmp targ-1 + +L102A jmp targ + +L102D jmp targ+1 + +calls jsr L1015 + jsr L101E + jsr L1021 + jsr L1024 + jsr L1027 + jsr L102A + jsr L102D + jmp L1160 + + hex 808182838485868788898a8b8c8d8e8f808182838485868788898a8b8c8d8e8f ;bulky + hex 808182838485868788898a8b8c8d8e8f808182838485868788898a8b8c8d8e8f + hex 808182838485868788898a8b8c8d8e8f808182838485868788898a8b8c8d8e8f + hex 808182838485868788898a8b8c8d8e8f + asc 'This is a long string. Put a label and comment on it to confir' ;stringy + asc 'm that the label and comment only appear on the first line. T' + asc 'he quick brown fox jumps over the lazy dogs.' + +L1160 adc #BMI + rts + diff --git a/SourceGen/SGTestData/Expected/20030-labels-and-symbols_acme.S b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_acme.S new file mode 100644 index 0000000..ec48228 --- /dev/null +++ b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_acme.S @@ -0,0 +1,111 @@ +;Project was edited to add a label in the middle of a dense hex region, and add +;a duplicate label. + !cpu 6502 +BMI1 = $30 ;opcode mnemonic +zip = $cd +absl = $1029 +absh = $feed + +plataddr = $3000 ;address only in platform file +projalsa = $3200 ;same val as projalso + +* = $0000 + !pseudopc $2345 { +start lda #zip + lda #zip+16 + lda #zip-192 + lda #absh + lda #absh)+1 + lda #absl + lda #absl)-1 + lda #start + lda zip+1 + lda+2 zip+1 + lda absh-1 + lda absh+1 + lda start+1 + lda start-1 + jmp @L23A3 + + !byte zip + !byte absh + !byte start + !word zip + !word absl + !word 0+(absl >> 8) + !word absl-$1000 + !word 0+(absl >> 8)-16 + !word absh + !word 0+(absh >> 8) + !word absh-$f000 + !word 0+(absh >> 8)+16 + !word start + !word 0+(start >> 8) + !word start+1 + !word 0+(start >> 8) + !byte $fe,$ed + !24 zip + !24 absh + !24 0+(absh >> 8) + !24 start + !24 0+(start >> 8) + +@L23A3 jmp @L1000_1 + + } ;!pseudopc + !pseudopc $1000 { +@L1000_1 nop +@L1000 nop +@L1000_0 nop +@l1000 lda plataddr + lda $3100 + lda projalsa + lda $3300 + jmp calls + + nop +targ nop + nop +L1015 jsr targ-1 + jsr targ + jsr targ+1 +L101E jmp targ-1 + +L1021 jmp targ + +L1024 jmp targ+1 + +L1027 jmp targ-1 + +L102A jmp targ + +L102D jmp targ+1 + +calls jsr L1015 + jsr L101E + jsr L1021 + jsr L1024 + jsr L1027 + jsr L102A + jsr L102D + jmp L1160 + + !hex 808182838485868788898a8b8c8d8e8f808182838485868788898a8b8c8d8e8f ;bulky + !hex 808182838485868788898a8b8c8d8e8f808182838485868788898a8b8c8d8e8f + !hex 808182838485868788898a8b8c8d8e8f808182838485868788898a8b8c8d8e8f + !hex 808182838485868788898a8b8c8d8e8f + !text "This is a long string. Put a label and comment on it to confir" ;stringy + !text "m that the label and comment only appear on the first line. T" + !text "he quick brown fox jumps over the lazy dogs." + +L1160 adc #BMI1 + rts + + } ;!pseudopc diff --git a/SourceGen/SGTestData/Expected/20030-labels-and-symbols_cc65.S b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_cc65.S new file mode 100644 index 0000000..b9019ad --- /dev/null +++ b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_cc65.S @@ -0,0 +1,113 @@ +;Project was edited to add a label in the middle of a dense hex region, and add +;a duplicate label. + .setcpu "6502" +BMI1 = $30 ;opcode mnemonic +zip = $cd +absl = $1029 +absh = $feed + +plataddr = $3000 ;address only in platform file +projalsa = $3200 ;same val as projalso + +; .segment "SEG000" + .org $2345 +start: lda #zip + lda #zip+16 + lda #zip-192 + lda #absh + lda #absh+1 + lda #absl + lda #absl-1 + lda #start + lda zip+1 + lda a:zip+1 + lda absh-1 + lda absh+1 + lda start+1 + lda start-1 + jmp @L23A3 + + .byte zip + .byte absh + .byte start + .word zip + .word absl + .word absl >> 8 + .word absl-$1000 + .word absl >> 8 -16 + .word absh + .word absh >> 8 + .word absh-$f000 + .word absh >> 8 +16 + .word start + .word start >> 8 + .word start+1 + .word start >> 8 + .dbyt absh + .faraddr zip + .faraddr absh + .faraddr absh >> 8 + .faraddr start + .faraddr start >> 8 + +@L23A3: jmp @L1000_1 + +; .segment "SEG001" + .org $1000 +@L1000_1: nop +@L1000: nop +@L1000_0: nop +@l1000: lda plataddr + lda $3100 + lda projalsa + lda $3300 + jmp calls + + nop +targ: nop + nop +L1015: jsr targ-1 + jsr targ + jsr targ+1 +L101E: jmp targ-1 + +L1021: jmp targ + +L1024: jmp targ+1 + +L1027: jmp targ-1 + +L102A: jmp targ + +L102D: jmp targ+1 + +calls: jsr L1015 + jsr L101E + jsr L1021 + jsr L1024 + jsr L1027 + jsr L102A + jsr L102D + jmp L1160 + + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f ;bulky + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte $80,$81,$82,$83,$84,$85,$86,$87,$88,$89,$8a,$8b,$8c,$8d,$8e,$8f + .byte "This is a long string. Put a label and comment on it to confir" ;stringy + .byte "m that the label and comment only appear on the first line. T" + .byte "he quick brown fox jumps over the lazy dogs." + +L1160: adc #BMI1 + rts + diff --git a/SourceGen/SGTestData/Expected/20030-labels-and-symbols_cc65.cfg b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_cc65.cfg new file mode 100644 index 0000000..cf76195 --- /dev/null +++ b/SourceGen/SGTestData/Expected/20030-labels-and-symbols_cc65.cfg @@ -0,0 +1,13 @@ +# 6502bench SourceGen generated linker script for 20030-labels-and-symbols +MEMORY { + MAIN: file=%O, start=%S, size=65536; +# MEM000: file=%O, start=$2345, size=97; +# MEM001: file=%O, start=$1000, size=355; +} +SEGMENTS { + CODE: load=MAIN, type=rw; +# SEG000: load=MEM000, type=rw; +# SEG001: load=MEM001, type=rw; +} +FEATURES {} +SYMBOLS {} diff --git a/SourceGen/SGTestData/Source/20030-labels-and-symbols.S b/SourceGen/SGTestData/Source/20030-labels-and-symbols.S new file mode 100644 index 0000000..08c9849 --- /dev/null +++ b/SourceGen/SGTestData/Source/20030-labels-and-symbols.S @@ -0,0 +1,134 @@ +; Copyright 2018 faddenSoft. All Rights Reserved. +; See the LICENSE.txt file for distribution terms (Apache 2.0). +; +; This is a reduced version of the 65816-based test. +; +; Assembler: Merlin 32 + +absl equ $1029 +absh equ $feed +zip equ $cd + + org $2345 + +start ;set this label +; load 8/16-bit symbols in different ways + lda #zip + lda #zip+16 + lda #zip+64 + + lda #absh + lda #absh+64 + + lda #absl + lda #absl-64 + + lda #start + + lda zip+1 + lda: zip+1 + lda absh-1 + lda absh+1 + lda start+1 + lda start-1 + + jmp :skipdata + +; reference 16/24-bit symbol in data statements + dfb zip + dfb absh + dfb start + + dw zip + dw absl + dw absl-$1000 + dw absh + dw absh+$1000 + dw start + dw start+1 + + dfb >absh ;format as 16-bit big-endian + dfb absh + adr start + +:skipdata + jmp nextchunk + + org $1000 +nextchunk + nop ;leave this as auto-label + nop ;label this L1000 + nop ;label this L1000_0 + +plataddr equ $3000 ;address only in platform file +projover equ $3100 ;replaced by proj symbol w/same name, diff addr (no match) +projalso equ $3200 ;also in project, twice w/different name +/- alpha; low should win +nosym equ $3300 ;should not match anything + + lda plataddr + lda projover + lda projalso + lda nosym + + jmp next + +target0 nop +target1 nop ;point everything here +target2 nop + + +t0 jsr target0 + jsr target1 + jsr target2 +t1a jmp target0 +t1b jmp target1 +t1c jmp target2 +t3a jmp target0 +t3b jmp target1 +t3c jmp target2 + +next + jsr t0 + jsr t1a + jsr t1b + jsr t1c + jsr t3a + jsr t3b + jsr t3c + + jmp :skiphex + + hex 808182838485868788898a8b8c8d8e8f ;add label and comment + hex 808182838485868788898a8b8c8d8e8f + hex 808182838485868788898a8b8c8d8e8f + hex 808182838485868788898a8b8c8d8e8f + hex 808182838485868788898a8b8c8d8e8f + hex 808182838485868788898a8b8c8d8e8f + hex 808182838485868788898a8b8c8d8e8f + + asc 'This is a long string. Put a label and comment ' + asc 'on it to confirm that the label and comment only ' + asc 'appear on the first line. The quick brown fox ' + asc 'jumps over the lazy dogs.' + +:skiphex + adc #$30 ;set to BMI to test constant vs. instr + rts