added .quad asm directive
This commit is contained in:
parent
2a6c104722
commit
e657dfb491
2 changed files with 28 additions and 0 deletions
27
tccasm.c
27
tccasm.c
|
@ -361,6 +361,33 @@ static void asm_parse_directive(TCCState *s1)
|
||||||
}
|
}
|
||||||
ind += size;
|
ind += size;
|
||||||
break;
|
break;
|
||||||
|
case TOK_ASM_quad:
|
||||||
|
next();
|
||||||
|
for(;;) {
|
||||||
|
uint64_t vl;
|
||||||
|
const char *p;
|
||||||
|
|
||||||
|
p = tokc.cstr->data;
|
||||||
|
if (tok != TOK_PPNUM) {
|
||||||
|
error_constant:
|
||||||
|
error("64 bit constant");
|
||||||
|
}
|
||||||
|
vl = strtoll(p, (char **)&p, 0);
|
||||||
|
if (*p != '\0')
|
||||||
|
goto error_constant;
|
||||||
|
next();
|
||||||
|
if (sec->sh_type != SHT_NOBITS) {
|
||||||
|
/* XXX: endianness */
|
||||||
|
gen_le32(vl);
|
||||||
|
gen_le32(vl >> 32);
|
||||||
|
} else {
|
||||||
|
ind += 8;
|
||||||
|
}
|
||||||
|
if (tok != ',')
|
||||||
|
break;
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case TOK_ASM_byte:
|
case TOK_ASM_byte:
|
||||||
size = 1;
|
size = 1;
|
||||||
goto asm_data;
|
goto asm_data;
|
||||||
|
|
1
tcctok.h
1
tcctok.h
|
@ -191,6 +191,7 @@
|
||||||
DEF_ASM(previous)
|
DEF_ASM(previous)
|
||||||
DEF_ASM(fill)
|
DEF_ASM(fill)
|
||||||
DEF_ASM(org)
|
DEF_ASM(org)
|
||||||
|
DEF_ASM(quad)
|
||||||
|
|
||||||
#ifdef TCC_TARGET_I386
|
#ifdef TCC_TARGET_I386
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue