(uxnasm) Added support for = and - runes

This commit is contained in:
neauoire 2022-11-09 16:21:07 -08:00
parent 1b2049e238
commit 261b574671
1 changed files with 13 additions and 1 deletions

View File

@ -316,9 +316,14 @@ parse(char *w, FILE *f)
if(!writeshort(0xffff, 1)) return 0;
break;
case ':': /* raw short absolute */
case '=':
makereference(p.scope, w, p.ptr);
if(!writeshort(0xffff, 0)) return 0;
break;
case '-': /* raw byte absolute */
makereference(p.scope, w, p.ptr);
if(!writebyte(0xff)) return 0;
break;
case '"': /* raw string */
i = 0;
while((c = w[++i]))
@ -375,6 +380,7 @@ resolve(void)
l->refs++;
break;
case ';':
case '=':
if(!(l = findlabel(r->name)))
return error("Unknown absolute reference", r->name);
p.data[r->addr + 1] = l->addr >> 0x8;
@ -384,10 +390,16 @@ resolve(void)
case ':':
if(!(l = findlabel(r->name)))
return error("Unknown absolute reference", r->name);
p.data[r->addr + 0] = l->addr >> 0x8;
p.data[r->addr] = l->addr >> 0x8;
p.data[r->addr + 1] = l->addr & 0xff;
l->refs++;
break;
case '-':
if(!(l = findlabel(r->name)))
return error("Unknown absolute reference", r->name);
p.data[r->addr] = l->addr & 0xff;
l->refs++;
break;
default:
return error("Unknown reference", r->name);
}