Skip to content
Browse files

Add test case for label definitions.

  • Loading branch information
Prof9 committed Oct 24, 2019
1 parent e383dd6 commit e8edb7389804c75eaef406d9b433e67875a449f0
Showing with 70 additions and 0 deletions.
  1. +46 −0 Tests/Core/Labels/Labels.asm
  2. +1 −0 Tests/Core/Labels/commandLine.txt
  3. +23 −0 Tests/Core/Labels/expected.txt
@@ -0,0 +1,46 @@
.macro test,label
.notice °(label) + ": " + tohex(label,16)

.definelabel a1,0x00000000
.definelabel b1,0xFFFFFFFF
.definelabel c1,0x12345678
.definelabel d1,0xFFFFFFFFFFFFFFFF
.definelabel e1,0xFEDCBA9876543210
.definelabel f1,0x1234567890ABCDEF
.definelabel g1,0x1122334455667788

.create "output.bin",0

.org 0xDEADDEAD :: .org 0x00000000 :: a2:
.org 0xDEADDEAD :: .org 0xFFFFFFFF :: b2:
.org 0xDEADDEAD :: .org 0x12345678 :: c2:
.org 0xDEADDEAD :: .org 0xFFFFFFFFFFFFFFFF :: d2:
.org 0xDEADDEAD :: .org 0xFEDCBA9876543210 :: e2:
.org 0xDEADDEAD :: .org 0x1234567890ABCDEF :: f2:
.org 0xDEADDEAD :: .org 0x1122334455667788 :: g2:

test a0
test a1
test a2
test b0
test b1
test b2
test c0
test c1
test c2
test d0
test d1
test d2
test e0
test e1
test e2
test f0
test f1
test f2
test g0
test g1
test g2

@@ -0,0 +1 @@
1 -definelabel a0 0x00000000 -definelabel b0 0xFFFFFFFF -definelabel c0 0x12345678 -definelabel d0 0xFFFFFFFFFFFFFFFF -definelabel e0 0xFEDCBA9876543210 -definelabel f0 0x1234567890ABCDEF -definelabel g0 0x1122334455667788 Labels.asm
@@ -0,0 +1,23 @@
Labels.asm(19) error: Seeking to virtual address with negative physical address
Labels.asm(20) error: Seeking to virtual address with negative physical address
Labels.asm(24) notice: a0: 0000000000000000
Labels.asm(25) notice: a1: 0000000000000000
Labels.asm(26) notice: a2: 0000000000000000
Labels.asm(27) notice: b0: 00000000FFFFFFFF
Labels.asm(28) notice: b1: 00000000FFFFFFFF
Labels.asm(29) notice: b2: 00000000FFFFFFFF
Labels.asm(30) notice: c0: 0000000012345678
Labels.asm(31) notice: c1: 0000000012345678
Labels.asm(32) notice: c2: 0000000012345678
Labels.asm(33) notice: d0: FFFFFFFFFFFFFFFF
Labels.asm(34) notice: d1: FFFFFFFFFFFFFFFF
Labels.asm(35) notice: d2: 00000000DEADDEAD
Labels.asm(36) notice: e0: FEDCBA9876543210
Labels.asm(37) notice: e1: FEDCBA9876543210
Labels.asm(38) notice: e2: 00000000DEADDEAD
Labels.asm(39) notice: f0: 1234567890ABCDEF
Labels.asm(40) notice: f1: 1234567890ABCDEF
Labels.asm(41) notice: f2: 1234567890ABCDEF
Labels.asm(42) notice: g0: 1122334455667788
Labels.asm(43) notice: g1: 1122334455667788
Labels.asm(44) notice: g2: 1122334455667788

0 comments on commit e8edb73

Please sign in to comment.
You can’t perform that action at this time.