mirror of https://github.com/fachat/xa65.git
fix align bug
This commit is contained in:
parent
e51b1e7f41
commit
59a635ce37
|
@ -39,4 +39,6 @@
|
|||
t[i++] = f & 255; \
|
||||
} while (0)
|
||||
|
||||
#define wval_len 5 /* number of bytes stored in wval() call */
|
||||
|
||||
#endif /* __XA65_XAD_H__ */
|
||||
|
|
|
@ -834,12 +834,12 @@ printf("reloc: er=%d, l=%d, segment=%d, pc[%d]=%04x, pc[abs(%d)]=%04x, pc[text(%
|
|||
t[0]=Kdsb;
|
||||
i=1;
|
||||
bl=tmp=(tmp - (pc[segment] & (tmp-1))) & (tmp-1);
|
||||
wval(i,tmp, 0);
|
||||
wval(i,tmp, 0); // 5 byte
|
||||
t[i++]=',';
|
||||
tmp2= 0xea;
|
||||
wval(i,tmp2, 0); /* nop opcode */
|
||||
wval(i,tmp2, 0); /* nop opcode, another 5 byte */
|
||||
t[i++]=T_END;
|
||||
*ll=9;
|
||||
*ll=wval_len * 2 + 3; //13; //9;
|
||||
er=E_OKDEF;
|
||||
} else {
|
||||
*ll=0; /* ignore if aligned right */
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
|
||||
XA=../../xa
|
||||
|
||||
default: all
|
||||
all: t01 t02 t03 t11 t12 t13 t21 t22 t23 t31 t32 t33 t41 t42 t43
|
||||
|
||||
# BSD only has suffix rules
|
||||
|
||||
.SUFFIXES: .o65 .hex .a65
|
||||
|
||||
#%.o65: %.s
|
||||
.a65.o65:
|
||||
${XA} -R -c -o $@ $<
|
||||
|
||||
#%.hex: %.o65
|
||||
.o65.hex:
|
||||
../hextool $< > $@
|
||||
|
||||
###############################################
|
||||
# text segment correctly aligned
|
||||
|
||||
t01: t01.o65
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t02: t02.o65
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t03: t03.o65
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
###############################################
|
||||
# data segment correctly aligned
|
||||
|
||||
t11: t11.o65
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t12: t12.o65
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t13: t13.o65
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
###############################################
|
||||
# text segment incorrectly aligned
|
||||
|
||||
t21: t01.a65
|
||||
${XA} -R -c -bt 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t22: t02.a65
|
||||
${XA} -R -c -bt 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t23: t03.a65
|
||||
${XA} -R -c -bt 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
###############################################
|
||||
# text segment correctly aligned, but data segment not (even if empty)
|
||||
|
||||
t31: t01.a65
|
||||
${XA} -R -c -bd 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t32: t02.a65
|
||||
${XA} -R -c -bd 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t33: t03.a65
|
||||
${XA} -R -c -bd 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
###############################################
|
||||
# data segment incorrectly aligned
|
||||
|
||||
t41: t11.a65
|
||||
${XA} -R -c -bd 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t42: t12.a65
|
||||
${XA} -R -c -bd 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
t43: t13.a65
|
||||
${XA} -R -c -bd 1025 -o $@.o65 $< 2> $@.msg
|
||||
cmp $@.msg $@.mok
|
||||
cmp $@.o65 $@.ok
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *.o65 *.hex
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
.text
|
||||
|
||||
tay
|
||||
|
||||
.align 2
|
||||
|
||||
tay
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
|
||||
.text
|
||||
|
||||
tay
|
||||
|
||||
.align 4
|
||||
|
||||
tay
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
|
||||
.text
|
||||
|
||||
tay
|
||||
|
||||
.align 256
|
||||
|
||||
tay
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
|
||||
.data
|
||||
|
||||
tay
|
||||
|
||||
.align 2
|
||||
|
||||
tay
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
|
||||
.data
|
||||
|
||||
tay
|
||||
|
||||
.align 4
|
||||
|
||||
tay
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
|
||||
.data
|
||||
|
||||
tay
|
||||
|
||||
.align 256
|
||||
|
||||
tay
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: text segment ($0401) start address doesn't align to 2!
|
|
@ -0,0 +1 @@
|
|||
Warning: text segment ($0401) start address doesn't align to 2!
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: text segment ($0401) start address doesn't align to 4!
|
|
@ -0,0 +1 @@
|
|||
Warning: text segment ($0401) start address doesn't align to 4!
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: text segment ($0401) start address doesn't align to 256!
|
|
@ -0,0 +1 @@
|
|||
Warning: text segment ($0401) start address doesn't align to 256!
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 2!
|
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 2!
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 4!
|
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 4!
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 256!
|
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 256!
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 2!
|
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 2!
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 4!
|
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 4!
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 256!
|
|
@ -0,0 +1 @@
|
|||
Warning: data segment ($0401) start address doesn't align to 256!
|
Binary file not shown.
Loading…
Reference in New Issue