mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-16 19:15:10 +00:00
(uxnasm) Starting to merge buffers
This commit is contained in:
parent
c5a5eaff0e
commit
18f545f3c9
1 changed files with 14 additions and 2 deletions
16
src/uxnasm.c
16
src/uxnasm.c
|
@ -24,7 +24,7 @@ typedef struct {
|
|||
} Macro;
|
||||
|
||||
typedef struct {
|
||||
char name[0x40];
|
||||
char *name;
|
||||
Uint16 addr, refs;
|
||||
} Label;
|
||||
|
||||
|
@ -73,6 +73,18 @@ static char *scat(char *dst, char *src) { char *ptr = dst + slen(dst); while(*sr
|
|||
|
||||
/* clang-format on */
|
||||
|
||||
char storage[0x10000], *storenext = storage;
|
||||
|
||||
static char *
|
||||
store(char *s)
|
||||
{
|
||||
char *ptr = storenext;
|
||||
while((*storenext++ = *s++))
|
||||
;
|
||||
*storenext++ = 0;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
static int parse(char *w, FILE *f);
|
||||
static char *makesublabel(char *src, char *name);
|
||||
|
||||
|
@ -180,7 +192,7 @@ makelabel(char *name, int setscope)
|
|||
l = &p.labels[p.label_len++];
|
||||
l->addr = p.ptr;
|
||||
l->refs = 0;
|
||||
scpy(name, l->name, 0x40);
|
||||
l->name = store(name);
|
||||
if(setscope) {
|
||||
int i = 0;
|
||||
while(name[i] != '/' && i < 0x3e && (scope[i] = name[i])) i++;
|
||||
|
|
Loading…
Reference in a new issue