aboutsummaryrefslogtreecommitdiff
path: root/tccasm.c
diff options
context:
space:
mode:
authorbellard <bellard>2004-10-25 18:54:29 +0000
committerbellard <bellard>2004-10-25 18:54:29 +0000
commite657dfb4914afe3972c5bae8cd640b46c4048e8c (patch)
tree4c61f9e06ae57963d1c2bf862a9ad94d7542fe6e /tccasm.c
parent2a6c104722a95fa2b8cdee448b102cfd47a0b08e (diff)
downloadtinycc-e657dfb4914afe3972c5bae8cd640b46c4048e8c.tar.gz
tinycc-e657dfb4914afe3972c5bae8cd640b46c4048e8c.tar.bz2
added .quad asm directive
Diffstat (limited to 'tccasm.c')
-rw-r--r--tccasm.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/tccasm.c b/tccasm.c
index 26117ad..bbd7e2c 100644
--- a/tccasm.c
+++ b/tccasm.c
@@ -361,6 +361,33 @@ static void asm_parse_directive(TCCState *s1)
}
ind += size;
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:
size = 1;
goto asm_data;