1
0
mirror of https://github.com/fachat/xa65.git synced 2024-06-08 07:29:39 +00:00

create error on negative dsb offsets

This commit is contained in:
Andre Fachat 2019-11-10 15:45:29 +01:00
parent a98b3770ee
commit 663b94a281
6 changed files with 33 additions and 1 deletions

View File

@ -1213,7 +1213,9 @@ fprintf(stderr, "mvn mvp: %i %i %i %i %i\n", t[0], t[i], wide, i, j);
er=E_ILLPOINTER;
else
*/
{
if (j < 0) {
er = E_ILLQUANT;
} else {
dsb_len = 0;
if(t[i+1]==',') {

12
xa/tests/dsb/Makefile Normal file
View File

@ -0,0 +1,12 @@
default: test1 test2
test1:
../../xa -R -LLIB6502 test1.s -o test1.o
../hextool -cmp=ok1 < test1.o
test2:
# this test must fail.
../../xa -R -LLIB6502 test2.s -o test2.o || exit 0 && exit 1
clean:
rm -f *.o

BIN
xa/tests/dsb/ok1 Normal file

Binary file not shown.

BIN
xa/tests/dsb/test1.o Normal file

Binary file not shown.

9
xa/tests/dsb/test1.s Normal file
View File

@ -0,0 +1,9 @@
.text
.dsb 10, 32
.dsb 5, 'a'

9
xa/tests/dsb/test2.s Normal file
View File

@ -0,0 +1,9 @@
.text
.dsb -10, 32
.dsb 5, 'a'