1
0
mirror of https://github.com/fachat/xa65.git synced 2024-06-17 20:29:32 +00:00

fix ldo data relocation

This commit is contained in:
Andre Fachat 2023-10-15 11:26:52 +02:00
parent d88303c607
commit 633c36ee81
10 changed files with 70 additions and 6 deletions

View File

@ -320,17 +320,17 @@ int main(int argc, char *argv[]) {
&lasttaddr, // last relocated target address
&tro, // pointer in output reloc bufer
file);
#if 0
reloc_seg(file->buf,
file->dpos,
file->dbase,
file->ddiff,
file->drpos,
treloc,
dreloc,
&lastdaddr,
&dro,
file);
#endif
// change file information to relocated values
file->tbase += file->tdiff;
file->dbase += file->ddiff;

4
xa/tests/ldoreloc/40.s Normal file
View File

@ -0,0 +1,4 @@
foo =$1234
jsr bla
loop: jmp loop

7
xa/tests/ldoreloc/41.s Normal file
View File

@ -0,0 +1,7 @@
jsr loop
bla: jmp bla
lda foo
lda #<foo
lda #>foo

8
xa/tests/ldoreloc/50.s Normal file
View File

@ -0,0 +1,8 @@
foo =$1234
jsr bla
loop: jmp loop
.data
bar .word bla

11
xa/tests/ldoreloc/51.s Normal file
View File

@ -0,0 +1,11 @@
jsr loop
bla: lda bar
.data
.word foo
.word bar
.byte <foo
.byte >foo

View File

@ -1,6 +1,6 @@
default: all
all: t1 t2 t10 t11 t20 t21 t30 t31 clean
all: t1 t2 t10 t11 t20 t21 t30 t31 t40 t41 t50 t51 clean
%.o65: %.s
../../xa -R -c -o $@ $<
@ -32,6 +32,18 @@ linked30.o65: 30.o65 31.o65
linked31.o65: 30.o65 31.o65
../../ldo65 -o $@ 31.o65 30.o65
linked40.o65: 40.o65 41.o65
../../ldo65 -o $@ 40.o65 41.o65
linked41.o65: 40.o65 41.o65
../../ldo65 -o $@ 41.o65 40.o65
linked50.o65: 50.o65 51.o65
../../ldo65 -o $@ 50.o65 51.o65
linked51.o65: 50.o65 51.o65
../../ldo65 -o $@ 51.o65 50.o65
t1: linked.o65
../../reloc65 -bt 32768 -xt -o $@ $<
../hextool $@ > $@.hex
@ -72,6 +84,26 @@ t31: linked31.o65
../hextool $@ > $@.hex
../hextool -cmp=$@ < t31.ok
clean:
rm -f *.o65 *.hex t1 t2 t10 t11 t20 t21 t30 t31
t40: linked40.o65
../../reloc65 -bt 32768 -xt -o $@ $<
../hextool $@ > $@.hex
../hextool -cmp=$@ < t40.ok
t41: linked41.o65
../../reloc65 -bt 32768 -xt -o $@ $<
../hextool $@ > $@.hex
../hextool -cmp=$@ < t41.ok
t50: linked50.o65
../../reloc65 -bt 32768 -bd 40960 -o $@ $<
../hextool $@ > $@.hex
../hextool -cmp=$@ < t50.ok
t51: linked51.o65
../../reloc65 -bt 32768 -bd 40960 -o $@ $<
../hextool $@ > $@.hex
../hextool -cmp=$@ < t51.ok
clean:
rm -f *.o65 *.hex t1 t2 t10 t11 t20 t21 t30 t31 t40 t41 t50 t51

1
xa/tests/ldoreloc/t40.ok Normal file
View File

@ -0,0 +1 @@
<09>L<03> <03>L <09><>4<12>4<EFBFBD>

1
xa/tests/ldoreloc/t41.ok Normal file
View File

@ -0,0 +1 @@
<10>L<03><>4<12>4<EFBFBD> <03>L<10>

BIN
xa/tests/ldoreloc/t50.ok Normal file

Binary file not shown.

BIN
xa/tests/ldoreloc/t51.ok Normal file

Binary file not shown.