aboutsummaryrefslogtreecommitdiff
path: root/i386-asm.c
diff options
context:
space:
mode:
authorJoe Soroka <gits@joesoroka.com>2011-02-01 15:37:58 -0800
committerJoe Soroka <gits@joesoroka.com>2011-02-01 15:37:58 -0800
commit87d84b7cb8b41a4ebf8dda39edc74acc1382d0e6 (patch)
treeeab7079ea2a0719e3120ac352eb15077fac02075 /i386-asm.c
parenta25325e9be13e52a198807b443bdfbfbe5dcaf33 (diff)
downloadtinycc-87d84b7cb8b41a4ebf8dda39edc74acc1382d0e6.tar.gz
tinycc-87d84b7cb8b41a4ebf8dda39edc74acc1382d0e6.tar.bz2
tccasm: allow one-line prefix+op things like "rep stosb"
Diffstat (limited to 'i386-asm.c')
-rw-r--r--i386-asm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/i386-asm.c b/i386-asm.c
index 075d2ea..2623ef6 100644
--- a/i386-asm.c
+++ b/i386-asm.c
@@ -574,6 +574,11 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode)
static int a32 = 0, o32 = 0, addr32 = 0, data32 = 0;
#endif
+ /* force synthetic ';' after prefix instruction, so we can handle */
+ /* one-line things like "rep stosb" instead of only "rep\nstosb" */
+ if (opcode >= TOK_ASM_wait && opcode <= TOK_ASM_repnz)
+ unget_tok(';');
+
/* get operands */
pop = ops;
nb_ops = 0;