Improve testing PC

This commit is contained in:
ISSOtm
2020-02-13 20:20:35 +01:00
parent f01a227470
commit 30a95d735a
7 changed files with 26 additions and 6 deletions

View File

@@ -52,6 +52,8 @@ SECTION "fixed PC", ROM0[420]
; Diffing PC and a label from here should work
LocalFixed:
print_diff LocalFixed, @
ds 69
print_diff LocalFixed, @
SECTION "Floating PC", ROM0
; Diffing a constant and PC cannot work
@@ -65,3 +67,5 @@ SECTION "Floating PC", ROM0
; Diffing PC and a label from here should work
LocalFloating:
print_diff LocalFloating, @
ds 42
print_diff LocalFloating, @

View File

@@ -22,16 +22,16 @@ ERROR: label-diff.asm(49) -> label-diff.asm::print_diff(20):
Expected constant expression: 'Unknown' is not constant at assembly time
ERROR: label-diff.asm(49) -> label-diff.asm::print_diff(22):
Expected constant expression: 'Unknown' is not constant at assembly time
ERROR: label-diff.asm(58) -> label-diff.asm::print_diff(20):
Expected constant expression: PC is not constant at assembly time
ERROR: label-diff.asm(58) -> label-diff.asm::print_diff(22):
Expected constant expression: PC is not constant at assembly time
ERROR: label-diff.asm(60) -> label-diff.asm::print_diff(20):
Expected constant expression: 'Known' is not constant at assembly time
Expected constant expression: PC is not constant at assembly time
ERROR: label-diff.asm(60) -> label-diff.asm::print_diff(22):
Expected constant expression: PC is not constant at assembly time
ERROR: label-diff.asm(62) -> label-diff.asm::print_diff(20):
Expected constant expression: 'Unknown' is not constant at assembly time
Expected constant expression: 'Known' is not constant at assembly time
ERROR: label-diff.asm(62) -> label-diff.asm::print_diff(22):
Expected constant expression: PC is not constant at assembly time
ERROR: label-diff.asm(64) -> label-diff.asm::print_diff(20):
Expected constant expression: 'Unknown' is not constant at assembly time
ERROR: label-diff.asm(64) -> label-diff.asm::print_diff(22):
Expected constant expression: PC is not constant at assembly time
error: Assembly aborted (18 errors)!

View File

@@ -20,6 +20,8 @@ $0
$0
$0
$0
$FFFFFFBB
$45
$0
$0
$0
@@ -30,3 +32,5 @@ $0
$0
$0
$0
$FFFFFFD6
$2A

10
test/asm/pc.asm Normal file
View File

@@ -0,0 +1,10 @@
SECTION "fixed", ROM0[420]
PRINTT "{@}\n"
ds 69
PRINTT "{@}\n"
; FIXME: expected to land at $0000
SECTION "floating", ROM0
db @
ds 42
db @

0
test/asm/pc.err Normal file
View File

2
test/asm/pc.out Normal file
View File

@@ -0,0 +1,2 @@
$1A4
$1E9

BIN
test/asm/pc.out.bin Normal file

Binary file not shown.