1
0
mirror of https://github.com/fachat/xa65.git synced 2024-06-29 13:29:27 +00:00
This commit is contained in:
Andre Fachat 2021-05-10 08:06:52 +02:00
parent e8a6ba088e
commit 89d9989592
2 changed files with 17 additions and 15 deletions

View File

@ -31,11 +31,13 @@
#define cval(s) 256 * ((s)[1] & 255) + ((s)[0]&255) #define cval(s) 256 * ((s)[1] & 255) + ((s)[0]&255)
#define lval(s) 65536 * ((s)[2] & 255) + 256 * ((s)[1] & 255) + ((s)[0] & 255) #define lval(s) 65536 * ((s)[2] & 255) + 256 * ((s)[1] & 255) + ((s)[0] & 255)
#define wval(i, v) do { \
t[i++] = T_VALUE; \ #define wval(i, v, f) do { \
t[i++] = v & 255; \ t[i++] = T_VALUE; \
t[i++] = (v >> 8) & 255; \ t[i++] = v & 255; \
t[i++] = (v >> 16) & 255; \ t[i++] = (v >> 8) & 255; \
} while (0) t[i++] = (v >> 16) & 255; \
t[i++] = f & 255; \
} while (0)
#endif /* __XA65_XAD_H__ */ #endif /* __XA65_XAD_H__ */

View File

@ -387,7 +387,7 @@ fprintf(stderr, "- p1 %d starting -\n", pc[segment]);
if(!(er=a_term(t+1,&tmp /*&pc[SEG_ABS]*/,&l,pc[segment],&afl,&label,0))) if(!(er=a_term(t+1,&tmp /*&pc[SEG_ABS]*/,&l,pc[segment],&afl,&label,0)))
{ {
i=1; i=1;
wval(i,tmp /*pc[SEG_ABS]*/); wval(i,tmp /*pc[SEG_ABS]*/,'d');
t[i++]=T_END; t[i++]=T_END;
*ll=6; *ll=6;
er=E_OKDEF; er=E_OKDEF;
@ -412,7 +412,7 @@ printf(" wrote %02x %02x %02x %02x %02x %02x\n",
segment, pc[segment], pc[SEG_ABS], pc[SEG_TEXT]);*/ segment, pc[segment], pc[SEG_ABS], pc[SEG_TEXT]);*/
t[0]=Kreloc; t[0]=Kreloc;
i=1; i=1;
wval(i,pc[SEG_TEXT]); wval(i,pc[SEG_TEXT],'d');
t[i++]=T_END; t[i++]=T_END;
*ll=6; *ll=6;
er=E_OKDEF; er=E_OKDEF;
@ -636,10 +636,10 @@ printf(" wrote %02x %02x %02x %02x %02x %02x\n",
t[0]=Kdsb; t[0]=Kdsb;
i=1; i=1;
bl=tmp=(tmp - (pc[segment] & (tmp-1))) & (tmp-1); bl=tmp=(tmp - (pc[segment] & (tmp-1))) & (tmp-1);
wval(i,tmp); wval(i,tmp,'d');
t[i++]=','; t[i++]=',';
tmp2= 0xea; tmp2= 0xea;
wval(i,tmp2); /* nop opcode */ wval(i,tmp2,'d'); /* nop opcode */
t[i++]=T_END; t[i++]=T_END;
*ll=9; *ll=9;
er=E_OKDEF; er=E_OKDEF;
@ -1806,7 +1806,7 @@ static int t_conv(signed char *s, signed char *t, int *l, int pc, int *nk,
t[q++]=v & 255; t[q++]=v & 255;
t[q++]=(v>>8) & 255; t[q++]=(v>>8) & 255;
} else { } else {
wval(q,v); wval(q,v,'d');
} }
} else } else
if(er==E_NODEF) if(er==E_NODEF)
@ -1830,7 +1830,7 @@ fprintf(stderr, "could not find %s\n", (char *)s+p);
{ {
tg_dez(s+p,&ll,&v); tg_dez(s+p,&ll,&v);
p+=ll; p+=ll;
wval(q,v); wval(q,v,'d');
} }
else else
/* handle encodings: hex, binary, octal, quoted strings */ /* handle encodings: hex, binary, octal, quoted strings */
@ -1853,17 +1853,17 @@ fprintf(stderr, "could not find %s\n", (char *)s+p);
case '$': case '$':
tg_hex(s+p+1,&ll,&v); tg_hex(s+p+1,&ll,&v);
p+=1+ll; p+=1+ll;
wval(q,v); wval(q,v,'$');
break; break;
case '%': case '%':
tg_bin(s+p+1,&ll,&v); tg_bin(s+p+1,&ll,&v);
p+=1+ll; p+=1+ll;
wval(q,v); wval(q,v,'%');
break; break;
case '&': case '&':
tg_oct(s+p+1,&ll,&v); tg_oct(s+p+1,&ll,&v);
p+=1+ll; p+=1+ll;
wval(q,v); wval(q,v,'&');
break; break;
case '\'': case '\'':
case '\"': case '\"':