1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-12-01 22:50:35 +00:00

Minor fix for 24-bit MULTI_MASK

The test for max allowed value was assuming 16-bit addresses.

We had no tests for 24-bit values, so this adds a 65816-specific
version of 20170-external-symbols.
This commit is contained in:
Andy McFadden 2020-11-03 11:47:53 -08:00
parent 3ddf9d11c4
commit 9321f15052
13 changed files with 608 additions and 4 deletions

View File

@ -283,7 +283,7 @@ namespace SourceGen {
out string badMaskMsg) {
Debug.Assert(line.StartsWith(MULTI_MASK_CMD));
const int MIN = 0;
const int MAX = 0x00ffff;
const int MAX = 0x00ffffff;
badMaskMsg = Res.Strings.ERR_INVALID_MULTI_MASK;
multiMask = null;

View File

@ -1,7 +1,7 @@
; Copyright 2019 faddenSoft. All Rights Reserved.
; See the LICENSE.txt file for distribution terms (Apache 2.0).
*SYNOPSIS Symbol set 1 for test 2021-external-symbols
*SYNOPSIS Symbol set 1 for test 20170-external-symbols
; Platform symbols aren't applied to file data.
CodeWrap @ $0f00 $1000 ;encases program

View File

@ -1,7 +1,7 @@
; Copyright 2019 faddenSoft. All Rights Reserved.
; See the LICENSE.txt file for distribution terms (Apache 2.0).
*SYNOPSIS Symbol set 2 for test 2021-external-symbols
*SYNOPSIS Symbol set 2 for test 20170-external-symbols
; override 2nd and 3rd
SameName2 @ $2011

View File

@ -1,7 +1,7 @@
; Copyright 2019 faddenSoft. All Rights Reserved.
; See the LICENSE.txt file for distribution terms (Apache 2.0).
*SYNOPSIS Symbol set 3 for test 2021-external-symbols
*SYNOPSIS Symbol set 3 for test 20170-external-symbols
; override 3rd
SameName3 @ $2022

Binary file not shown.

View File

@ -0,0 +1,63 @@
### 6502bench SourceGen dis65 v1.0 ###
{
"_ContentVersion":4,
"FileDataLength":258,
"FileDataCrc32":-1921102947,
"ProjectProps":{
"CpuName":"65816",
"IncludeUndocumentedInstr":false,
"TwoByteBrk":false,
"EntryFlags":32702671,
"AutoLabelStyle":"Simple",
"AnalysisParams":{
"AnalyzeUncategorizedData":true,
"DefaultTextScanMode":"LowHighAscii",
"MinCharsForString":4,
"SeekNearbyTargets":true,
"UseRelocData":false,
"SmartPlpHandling":false,
"SmartPlbHandling":true},
"PlatformSymbolFileIdentifiers":["PROJ:20172-external-symbols.sym65"],
"ExtensionScriptFileIdentifiers":[],
"ProjectSyms":{
}},
"AddressMap":[{
"Offset":0,
"Addr":4096}],
"TypeHints":[{
"Low":0,
"High":0,
"Hint":"Code"}],
"StatusFlagOverrides":{
},
"Comments":{
},
"LongComments":{
},
"Notes":{
},
"UserLabels":{
},
"OperandFormats":{
},
"LvTables":{
},
"Visualizations":[],
"VisualizationAnimations":[],
"VisualizationSets":{
},
"RelocList":{
},
"DbrValues":{
}}

View File

@ -0,0 +1,30 @@
; Copyright 2020 faddenSoft. All Rights Reserved.
; See the LICENSE.txt file for distribution terms (Apache 2.0).
*SYNOPSIS Symbol set for test 20172-external-symbols
; map 00/Cxxx and 01/Cxxx to 00/Cxxx
*MULTI_MASK $fef000 $00c000 $000fff
;addr_00 @ $00/c030
;addr_01 @ $01/c030
loaddr @ $c030
; map e0/Cxxx and e1/Cxxx to e0/Cxxx
*MULTI_MASK $fef000 $e0c000 $000fff
;addr_e0 @ $e0/c030
;addr_e1 @ $e1/c030
hiaddr @ $e0c030
; clear multi-mask
*MULTI_MASK
addr_02 @ $02/c030
addr_03 @ $03/c030
addr_e2 @ $e2/c030
addr_e3 @ $e3/c030
oth_00 @ $00/1234
oth_01 @ $01/1234
oth_02 @ $02/1234

View File

@ -0,0 +1,96 @@
.cpu "65816"
oth_00 = $1234
loaddr = $c030
oth_01 = $011234
oth_02 = $021234
addr_02 = $02c030
addr_03 = $03c030
hiaddr = $e0c030
addr_e2 = $e2c030
addr_e3 = $e3c030
* = $1000
.as
.xs
clc
xce
sep #$30
phk
plb
lda loaddr
lda loaddr+$10000
lda addr_02
lda addr_03
lda hiaddr
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda oth_00
lda oth_01
lda oth_02
lda #$01
pha
plb
lda @lloaddr
lda loaddr
lda addr_02
lda addr_03
lda hiaddr
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda @loth_00
lda oth_01 & $ffff
lda oth_02
lda #$02
pha
plb
lda @lloaddr
lda loaddr+$10000
lda addr_02 & $ffff
lda addr_03
lda hiaddr
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda @loth_00
lda oth_01
lda oth_02 & $ffff
lda #$03
pha
plb
lda @lloaddr
lda loaddr+$10000
lda addr_02
lda addr_03 & $ffff
lda hiaddr
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda @loth_00
lda oth_01
lda oth_02
lda #$e0
pha
plb
lda @lloaddr
lda loaddr+$10000
lda addr_02
lda addr_03
lda hiaddr & $ffff
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda #$e1
pha
plb
lda @lloaddr
lda loaddr+$10000
lda addr_02
lda addr_03
lda hiaddr
lda hiaddr & $ffff
lda addr_e2
lda addr_e3
rts

View File

@ -0,0 +1,96 @@
!cpu 65816
oth_00 = $1234
loaddr = $c030
oth_01 = $011234
oth_02 = $021234
addr_02 = $02c030
addr_03 = $03c030
hiaddr = $e0c030
addr_e2 = $e2c030
addr_e3 = $e3c030
* = $1000
!as
!rs
clc
xce
sep #$30
phk
plb
lda loaddr
lda+3 loaddr+$10000
lda+3 addr_02
lda+3 addr_03
lda+3 hiaddr
lda+3 hiaddr+$10000
lda+3 addr_e2
lda+3 addr_e3
lda oth_00
lda+3 oth_01
lda+3 oth_02
lda #$01
pha
plb
lda+3 loaddr
lda loaddr
lda+3 addr_02
lda+3 addr_03
lda+3 hiaddr
lda+3 hiaddr+$10000
lda+3 addr_e2
lda+3 addr_e3
lda+3 oth_00
lda oth_01 & $ffff
lda+3 oth_02
lda #$02
pha
plb
lda+3 loaddr
lda+3 loaddr+$10000
lda addr_02 & $ffff
lda+3 addr_03
lda+3 hiaddr
lda+3 hiaddr+$10000
lda+3 addr_e2
lda+3 addr_e3
lda+3 oth_00
lda+3 oth_01
lda oth_02 & $ffff
lda #$03
pha
plb
lda+3 loaddr
lda+3 loaddr+$10000
lda+3 addr_02
lda addr_03 & $ffff
lda+3 hiaddr
lda+3 hiaddr+$10000
lda+3 addr_e2
lda+3 addr_e3
lda+3 oth_00
lda+3 oth_01
lda+3 oth_02
lda #$e0
pha
plb
lda+3 loaddr
lda+3 loaddr+$10000
lda+3 addr_02
lda+3 addr_03
lda hiaddr & $ffff
lda+3 hiaddr+$10000
lda+3 addr_e2
lda+3 addr_e3
lda #$e1
pha
plb
lda+3 loaddr
lda+3 loaddr+$10000
lda+3 addr_02
lda+3 addr_03
lda+3 hiaddr
lda hiaddr & $ffff
lda+3 addr_e2
lda+3 addr_e3
rts

View File

@ -0,0 +1,97 @@
.setcpu "65816"
oth_00 = $1234
loaddr = $c030
oth_01 = $011234
oth_02 = $021234
addr_02 = $02c030
addr_03 = $03c030
hiaddr = $e0c030
addr_e2 = $e2c030
addr_e3 = $e3c030
; .segment "SEG000"
.org $1000
.a8
.i8
clc
xce
sep #$30
phk
plb
lda loaddr
lda loaddr+$10000
lda addr_02
lda addr_03
lda hiaddr
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda oth_00
lda oth_01
lda oth_02
lda #$01
pha
plb
lda f:loaddr
lda loaddr
lda addr_02
lda addr_03
lda hiaddr
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda f:oth_00
lda oth_01 & $ffff
lda oth_02
lda #$02
pha
plb
lda f:loaddr
lda loaddr+$10000
lda addr_02 & $ffff
lda addr_03
lda hiaddr
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda f:oth_00
lda oth_01
lda oth_02 & $ffff
lda #$03
pha
plb
lda f:loaddr
lda loaddr+$10000
lda addr_02
lda addr_03 & $ffff
lda hiaddr
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda f:oth_00
lda oth_01
lda oth_02
lda #$e0
pha
plb
lda f:loaddr
lda loaddr+$10000
lda addr_02
lda addr_03
lda hiaddr & $ffff
lda hiaddr+$10000
lda addr_e2
lda addr_e3
lda #$e1
pha
plb
lda f:loaddr
lda loaddr+$10000
lda addr_02
lda addr_03
lda hiaddr
lda hiaddr & $ffff
lda addr_e2
lda addr_e3
rts

View File

@ -0,0 +1,11 @@
# 6502bench SourceGen generated linker script for 20172-external-symbols
MEMORY {
MAIN: file=%O, start=%S, size=65536;
# MEM000: file=%O, start=$1000, size=258;
}
SEGMENTS {
CODE: load=MAIN, type=rw;
# SEG000: load=MEM000, type=rw;
}
FEATURES {}
SYMBOLS {}

View File

@ -0,0 +1,93 @@
oth_00 equ $1234
loaddr equ $c030
oth_01 equ $011234
oth_02 equ $021234
addr_02 equ $02c030
addr_03 equ $03c030
hiaddr equ $e0c030
addr_e2 equ $e2c030
addr_e3 equ $e3c030
org $1000
clc
xce
sep #$30
phk
plb
lda loaddr
ldal loaddr+$10000
ldal addr_02
ldal addr_03
ldal hiaddr
ldal hiaddr+$10000
ldal addr_e2
ldal addr_e3
lda oth_00
ldal oth_01
ldal oth_02
lda #$01
pha
plb
ldal loaddr
lda loaddr
ldal addr_02
ldal addr_03
ldal hiaddr
ldal hiaddr+$10000
ldal addr_e2
ldal addr_e3
ldal oth_00
lda oth_01
ldal oth_02
lda #$02
pha
plb
ldal loaddr
ldal loaddr+$10000
lda addr_02
ldal addr_03
ldal hiaddr
ldal hiaddr+$10000
ldal addr_e2
ldal addr_e3
ldal oth_00
ldal oth_01
lda oth_02
lda #$03
pha
plb
ldal loaddr
ldal loaddr+$10000
ldal addr_02
lda addr_03
ldal hiaddr
ldal hiaddr+$10000
ldal addr_e2
ldal addr_e3
ldal oth_00
ldal oth_01
ldal oth_02
lda #$e0
pha
plb
ldal loaddr
ldal loaddr+$10000
ldal addr_02
ldal addr_03
lda hiaddr
ldal hiaddr+$10000
ldal addr_e2
ldal addr_e3
lda #$e1
pha
plb
ldal loaddr
ldal loaddr+$10000
ldal addr_02
ldal addr_03
ldal hiaddr
lda hiaddr
ldal addr_e2
ldal addr_e3
rts

View File

@ -0,0 +1,118 @@
; Copyright 2020 faddenSoft. All Rights Reserved.
; See the LICENSE.txt file for distribution terms (Apache 2.0).
;
; Assembler: Merlin 32
; EDIT: set up a pair of MULTI_MASKs for 00/01 and e0/e1
addr_00 equ $00c030
addr_01 equ $01c030
addr_02 equ $02c030
addr_03 equ $03c030
addr_e0 equ $e0c030
addr_e1 equ $e1c030
addr_e2 equ $e2c030
addr_e3 equ $e3c030
oth_00 equ $001234
oth_01 equ $011234
oth_02 equ $021234
org $1000
clc
xce
sep #$30
mx %11
; bank 00
phk
plb
lda: addr_00
ldal addr_01
ldal addr_02
ldal addr_03
ldal addr_e0
ldal addr_e1
ldal addr_e2
ldal addr_e3
lda: oth_00
ldal oth_01
ldal oth_02
; bank 01
lda #$01
pha
plb
ldal addr_00
lda: addr_01
ldal addr_02
ldal addr_03
ldal addr_e0
ldal addr_e1
ldal addr_e2
ldal addr_e3
ldal oth_00
lda: oth_01
ldal oth_02
; bank 02
lda #$02
pha
plb
ldal addr_00
ldal addr_01
lda: addr_02
ldal addr_03
ldal addr_e0
ldal addr_e1
ldal addr_e2
ldal addr_e3
ldal oth_00
ldal oth_01
lda: oth_02
; bank 03
lda #$03
pha
plb
ldal addr_00
ldal addr_01
ldal addr_02
lda: addr_03
ldal addr_e0
ldal addr_e1
ldal addr_e2
ldal addr_e3
ldal oth_00
ldal oth_01
ldal oth_02
; bank e0
lda #$e0
pha
plb
ldal addr_00
ldal addr_01
ldal addr_02
ldal addr_03
lda: addr_e0
ldal addr_e1
ldal addr_e2
ldal addr_e3
; bank e1
lda #$e1
pha
plb
ldal addr_00
ldal addr_01
ldal addr_02
ldal addr_03
ldal addr_e0
lda: addr_e1
ldal addr_e2
ldal addr_e3
END rts