mirror of
https://github.com/fachat/xa65.git
synced 2025-04-08 18:37:12 +00:00
fix ldo data relocation
This commit is contained in:
parent
d88303c607
commit
633c36ee81
@ -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
4
xa/tests/ldoreloc/40.s
Normal file
@ -0,0 +1,4 @@
|
||||
foo =$1234
|
||||
|
||||
jsr bla
|
||||
loop: jmp loop
|
7
xa/tests/ldoreloc/41.s
Normal file
7
xa/tests/ldoreloc/41.s
Normal file
@ -0,0 +1,7 @@
|
||||
jsr loop
|
||||
bla: jmp bla
|
||||
lda foo
|
||||
lda #<foo
|
||||
lda #>foo
|
||||
|
||||
|
8
xa/tests/ldoreloc/50.s
Normal file
8
xa/tests/ldoreloc/50.s
Normal file
@ -0,0 +1,8 @@
|
||||
foo =$1234
|
||||
|
||||
jsr bla
|
||||
loop: jmp loop
|
||||
|
||||
.data
|
||||
bar .word bla
|
||||
|
11
xa/tests/ldoreloc/51.s
Normal file
11
xa/tests/ldoreloc/51.s
Normal file
@ -0,0 +1,11 @@
|
||||
jsr loop
|
||||
bla: lda bar
|
||||
|
||||
.data
|
||||
|
||||
.word foo
|
||||
.word bar
|
||||
.byte <foo
|
||||
.byte >foo
|
||||
|
||||
|
@ -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
1
xa/tests/ldoreloc/t40.ok
Normal file
@ -0,0 +1 @@
|
||||
<09>L<03> <03>L <09><>4<12>4<EFBFBD>
|
1
xa/tests/ldoreloc/t41.ok
Normal file
1
xa/tests/ldoreloc/t41.ok
Normal file
@ -0,0 +1 @@
|
||||
<10>L<03><>4<12>4<EFBFBD> <03>L<10>
|
BIN
xa/tests/ldoreloc/t50.ok
Normal file
BIN
xa/tests/ldoreloc/t50.ok
Normal file
Binary file not shown.
BIN
xa/tests/ldoreloc/t51.ok
Normal file
BIN
xa/tests/ldoreloc/t51.ok
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user