(uxnasm) Housekeeping
This commit is contained in:
parent
389d6ce364
commit
4a028ed63b
17
src/uxnasm.c
17
src/uxnasm.c
|
@ -72,8 +72,8 @@ push(char *s, char c)
|
||||||
char *d = dict, *o = dictnext;
|
char *d = dict, *o = dictnext;
|
||||||
/* find */
|
/* find */
|
||||||
for(d = dict; d < dictnext; d++) {
|
for(d = dict; d < dictnext; d++) {
|
||||||
char *ss = s, *pp = d, a, b;
|
char *ss = s, *dd = d, a, b;
|
||||||
while((a = *pp++) == (b = *ss++))
|
while((a = *dd++) == (b = *ss++))
|
||||||
if(!a && !b) return d;
|
if(!a && !b) return d;
|
||||||
}
|
}
|
||||||
/* save */
|
/* save */
|
||||||
|
@ -335,12 +335,9 @@ parse(char *w, FILE *f, Context *ctx)
|
||||||
case '[':
|
case '[':
|
||||||
case ']': return 1;
|
case ']': return 1;
|
||||||
}
|
}
|
||||||
if(sihx(w))
|
if(sihx(w)) return writehex(w, ctx);
|
||||||
return writehex(w, ctx);
|
if(isopcode(w)) return writebyte(findopcode(w), ctx);
|
||||||
else if(isopcode(w))
|
if((m = findmacro(w))) return walkmacro(m, ctx);
|
||||||
return writebyte(findopcode(w), ctx);
|
|
||||||
else if((m = findmacro(w)))
|
|
||||||
return walkmacro(m, ctx);
|
|
||||||
return addref(w, ' ', ptr + 1) && writebyte(0x60, ctx) && writeshort(0xffff);
|
return addref(w, ' ', ptr + 1) && writebyte(0x60, ctx) && writeshort(0xffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,9 +399,7 @@ build(char *filename)
|
||||||
label_len,
|
label_len,
|
||||||
macro_len);
|
macro_len);
|
||||||
/* sym */
|
/* sym */
|
||||||
if(slen(filename) > 0x60 - 5)
|
if(slen(filename) > 0x5b || !(dstsym = fopen(scat(scpy(filename, sympath, slen(filename) + 1), ".sym"), "w")))
|
||||||
return !error_top("Invalid symbols file", filename);
|
|
||||||
if(!(dstsym = fopen(scat(scpy(filename, sympath, slen(filename) + 1), ".sym"), "w")))
|
|
||||||
return !error_top("Invalid symbols file", filename);
|
return !error_top("Invalid symbols file", filename);
|
||||||
for(i = 0; i < label_len; i++) {
|
for(i = 0; i < label_len; i++) {
|
||||||
Uint8 hb = labels[i].addr >> 8, lb = labels[i].addr;
|
Uint8 hb = labels[i].addr >> 8, lb = labels[i].addr;
|
||||||
|
|
Loading…
Reference in New Issue