From e657dfb4914afe3972c5bae8cd640b46c4048e8c Mon Sep 17 00:00:00 2001 From: bellard Date: Mon, 25 Oct 2004 18:54:29 +0000 Subject: [PATCH] added .quad asm directive --- tccasm.c | 27 +++++++++++++++++++++++++++ tcctok.h | 1 + 2 files changed, 28 insertions(+) diff --git a/tccasm.c b/tccasm.c index 26117adb..bbd7e2c4 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; diff --git a/tcctok.h b/tcctok.h index bda455cd..abac1a8e 100644 --- a/tcctok.h +++ b/tcctok.h @@ -191,6 +191,7 @@ DEF_ASM(previous) DEF_ASM(fill) DEF_ASM(org) + DEF_ASM(quad) #ifdef TCC_TARGET_I386 -- 2.11.4.GIT