(uxnasm) Housekeeping

This commit is contained in:
Devine Lu Linvega 2024-03-27 16:14:02 -07:00
parent 3c1a4ec45c
commit 6b355e3d8e
1 changed files with 5 additions and 9 deletions

View File

@ -84,10 +84,8 @@ findopcode(char *s)
int i; int i;
for(i = 0; i < 0x20; i++) { for(i = 0; i < 0x20; i++) {
int m = 3; int m = 3;
if(!scmp(ops[i], s, 3)) if(!scmp(ops[i], s, 3)) continue;
continue; if(!i) i |= (1 << 7);
if(!i)
i |= (1 << 7);
while(s[m]) { while(s[m]) {
if(s[m] == '2') if(s[m] == '2')
i |= (1 << 5); i |= (1 << 5);
@ -194,7 +192,8 @@ makelabel(char *name, int setscope, Context *ctx)
l->refs = 0; l->refs = 0;
if(setscope) { if(setscope) {
int i = 0; int i = 0;
while(name[i] != '/' && i < 0x3e && (scope[i] = name[i])) i++; while(name[i] != '/' && i < 0x3e && (scope[i] = name[i]))
i++;
scope[i] = '\0'; scope[i] = '\0';
} }
return 1; return 1;
@ -329,15 +328,12 @@ parse(char *w, FILE *f, Context *ctx)
return writebyte(findopcode(w), ctx); return writebyte(findopcode(w), ctx);
else if((m = findmacro(w))) else if((m = findmacro(w)))
return walkmacro(m, ctx); return walkmacro(m, ctx);
else return addref(w, ' ', ptr + 1) && writebyte(0x60, ctx) && writeshort(0xffff);
return addref(w, ' ', ptr + 1) && writebyte(0x60, ctx) && writeshort(0xffff);
return 1;
} }
static int static int
resolve(void) resolve(void)
{ {
int i; int i;
Uint16 a; Uint16 a;
for(i = 0; i < refs_len; i++) { for(i = 0; i < refs_len; i++) {