mirror of
https://github.com/fachat/xa65.git
synced 2025-04-08 18:37:12 +00:00
dsbexpr
This commit is contained in:
parent
780d1fed21
commit
c2fad8d3e0
17
xa/src/xa.c
17
xa/src/xa.c
@ -954,17 +954,6 @@ static void usage(int default816, FILE *fp)
|
||||
" --help display this help and exit\n");
|
||||
}
|
||||
|
||||
/*
|
||||
static char *ertxt[] = { "Syntax","Label definiert",
|
||||
"Label nicht definiert","Labeltabelle voll",
|
||||
"Label erwartet","Speicher voll","Illegaler Opcode",
|
||||
"Falsche Adressierungsart","Branch ausserhalb des Bereichs",
|
||||
"Ueberlauf","Division durch Null","Pseudo-Opcode erwartet",
|
||||
"Block-Stack-Ueberlauf","Datei nicht gefunden",
|
||||
"End of File","Block-Struktur nicht abgeschlossen",
|
||||
"NoBlk","NoKey","NoLine","OKDef","DSB","NewLine",
|
||||
"NewFile","CMOS-Befehl","pp:Falsche Anzahl Parameter" };
|
||||
*/
|
||||
static char *ertxt[] = {
|
||||
"Syntax", // E_SYNTAX =-1
|
||||
"Label already defined", // E_LABDEF =-2
|
||||
@ -1003,9 +992,9 @@ static char *ertxt[] = {
|
||||
"Illegal quantity", // E_ILLQUANT =-35
|
||||
".bin", // E_BIN =-36
|
||||
"#error directive", // E_UERROR =-37
|
||||
"Assertion", // E_AERROR =-38
|
||||
"Assertion", // E_AERROR =-38
|
||||
"DSB has negative length", // E_NEGDSBLEN =-39
|
||||
/* placeholders for future fatal errors */
|
||||
"", // -39
|
||||
"", // -40
|
||||
"", // -41
|
||||
"", // -42
|
||||
@ -1042,7 +1031,7 @@ static char *ertxt[] = {
|
||||
"Open preprocessor directive at end of file (intentional?)", // W_OPENPP =-72
|
||||
"Included binary data exceeds 64KB", // W_OVER64K =-73
|
||||
"Included binary data exceeds 16MB", // W_OVER16M =-74
|
||||
"MVN/MVP $XXXX syntax is deprecated and will be removed", // W_OLDMVNS =-75
|
||||
"Subtracting pointer from constant not supported in -R mode", // W_SUBTRACT =-75
|
||||
/* more placeholders */
|
||||
"", // -76
|
||||
"", // -77
|
||||
|
10
xa/src/xaa.c
10
xa/src/xaa.c
@ -201,15 +201,19 @@ printf("pointer: v=%04x, afl=%04x\n",*v,afl);
|
||||
{
|
||||
if(afl || *nafl) { /* check pointer arithmetic */
|
||||
if((afl == *nafl) && (afl!=SEG_UNDEFZP) && (afl!=SEG_UNDEF) && o==2) {
|
||||
afl = 0; /* substract two pointers */
|
||||
afl = 0; /* subtract two pointers */
|
||||
} else
|
||||
if(((afl && !*nafl) || (*nafl && !afl)) && o==1) {
|
||||
afl=(afl | *nafl); /* add constant to pointer */
|
||||
} else
|
||||
if((afl && !*nafl) && o==2) {
|
||||
afl=(afl | *nafl); /* substract constant from pointer */
|
||||
afl=(afl | *nafl); /* subtract constant from pointer */
|
||||
} else {
|
||||
/* allow math in the same segment */
|
||||
if((!afl && *nafl) && o==2) {
|
||||
/* subtract pointer from constant */
|
||||
errout(W_SUBTRACT);
|
||||
}
|
||||
/* allow math in the same segment */
|
||||
if(segment!=SEG_ABS && segment != afl) {
|
||||
if(!dsb_len) {
|
||||
/*printf("ILLPOINTER=dsb_len=%d,segment=%d\n",dsb_len, segment);*/
|
||||
|
@ -140,6 +140,8 @@ typedef struct {
|
||||
#define E_BIN -36 /* okdef */
|
||||
#define E_UERROR -37 /* #error */
|
||||
#define E_AERROR -38 /* .assert failed */
|
||||
#define E_NEGDSBLEN -39 /* .dsb has negative length */
|
||||
|
||||
/* errors thru 64 are placeholders available for use */
|
||||
|
||||
#define W_ADRRELOC -65 /* word relocation in byte value */
|
||||
@ -152,6 +154,7 @@ typedef struct {
|
||||
#define W_OPENPP -72 /* warning about open preprocessor directive */
|
||||
#define W_OVER64K -73 /* included binary over 64K in 6502 mode */
|
||||
#define W_OVER16M -74 /* included binary over 16M in 65816 mode */
|
||||
#define W_SUBTRACT -75 /* subtract a segment pointer from a constant - not supported in -R mode */
|
||||
/* warnings 75-77 are placeholders available for use */
|
||||
|
||||
/* Meta-values for the token list. Note must not overlap with the
|
||||
|
@ -1623,7 +1623,7 @@ fprintf(stderr, "mvn mvp: %i %i %i %i %i\n", t[0], t[i], wide, i, j);
|
||||
if(!(er=a_term(t+1,&j,&i,pc[segment],&afl,&label,0)))
|
||||
{
|
||||
if (j<0)
|
||||
er=E_SYNTAX;
|
||||
er=E_NEGDSBLEN;
|
||||
else
|
||||
/*
|
||||
if(t[i+1]!=',')
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
XA=../../xa
|
||||
|
||||
all: test1 test2
|
||||
all: test1 test2 test3
|
||||
|
||||
test1: test1.a65
|
||||
${XA} -XC -R -U $<
|
||||
@ -9,3 +9,6 @@ test1: test1.a65
|
||||
test2: test2.a65
|
||||
${XA} -R -U $<
|
||||
|
||||
test3: test3.a65
|
||||
${XA} -R -U $<
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user