From 8216c6f489050a3a3964e8536266ab195f3ec757 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 11 Apr 2021 22:03:55 -0400 Subject: [PATCH 1/2] linker was relocating absolute entries (ie xxx equ $1234 ; ent xxx). $20 is the bit in the on-disk symbol table for an absolute entry, linkabsbit (%0000_0100_0000_0000) is the correct bit in memory. --- src/link/linker.1.s | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/link/linker.1.s b/src/link/linker.1.s index 682ebdc..082cc75 100644 --- a/src/link/linker.1.s +++ b/src/link/linker.1.s @@ -2464,7 +2464,7 @@ relocatefinal sta [tempptr],y sta omfoff2 lda foundlable+o_labtype - and #$0020 + and #linkabsbit jne :clc lda #$02 sta omfbytes @@ -2549,7 +2549,7 @@ relocatefinal sta [tempptr],y lda foundlable+o_labtype - and #$0020 + and #linkabsbit jne :clc bit interseg @@ -2690,7 +2690,7 @@ relocatefinal sta [tempptr],y rep $20 lda foundlable+o_labtype - and #$0020 ;absolute lable? + and #linkabsbit ;absolute lable? jne :clc bit interseg @@ -2791,7 +2791,7 @@ relocatefinal sta [tempptr],y rep $20 lda foundlable+o_labtype - and #$0020 + and #linkabsbit jne :clc bit interseg @@ -2886,7 +2886,7 @@ relocatefinal sta [tempptr],y rep $20 lda foundlable+o_labtype - and #$0020 + and #linkabsbit jne :clc bit interseg @@ -3048,7 +3048,7 @@ relocatefinal sta [tempptr],y rep $20 lda foundlable+o_labtype - and #$0020 + and #linkabsbit jne :clc lda #$f5 @@ -3103,7 +3103,7 @@ relocatefinal sta [tempptr],y lda foundlable+o_labtype - and #$0020 + and #linkabsbit jne :clc lda #$f5 From 2b9f5856d8dd1f181445e80b5e50fcbbfcbe9469 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 12 Apr 2021 20:53:57 -0400 Subject: [PATCH 2/2] add test files for external abs --- testdata/3009-abs-ent-1.S | 12 ++++++++++++ testdata/3009-abs-ent-2.S | 11 +++++++++++ testdata/3009-abs-ent-link.S | 9 +++++++++ 3 files changed, 32 insertions(+) create mode 100644 testdata/3009-abs-ent-1.S create mode 100644 testdata/3009-abs-ent-2.S create mode 100644 testdata/3009-abs-ent-link.S diff --git a/testdata/3009-abs-ent-1.S b/testdata/3009-abs-ent-1.S new file mode 100644 index 0000000..c3df800 --- /dev/null +++ b/testdata/3009-abs-ent-1.S @@ -0,0 +1,12 @@ + + rel + ent const +const equ $123456 ; only 24-bit value saved in rel dictionary. + + db const + dw const + adr const + adrl const + ddb const + + sav 3009-abs-ent-1.L diff --git a/testdata/3009-abs-ent-2.S b/testdata/3009-abs-ent-2.S new file mode 100644 index 0000000..c3a4050 --- /dev/null +++ b/testdata/3009-abs-ent-2.S @@ -0,0 +1,11 @@ + + rel + ext const + + db const + dw const + adr const + adrl const + ddb const + + sav 3009-abs-ent-2.L diff --git a/testdata/3009-abs-ent-link.S b/testdata/3009-abs-ent-link.S new file mode 100644 index 0000000..ce069bc --- /dev/null +++ b/testdata/3009-abs-ent-link.S @@ -0,0 +1,9 @@ +* link file +* generated file should not have any OMF relocation records. + + ovr all + asm 3009-abs-ent-1.S + asm 3009-abs-ent-2.S + lnk 3009-abs-ent-1.L + lnk 3009-abs-ent-2.L + sav 3009-abs-ent