From c0368604e196d53b281cd2aceb140b5facd36ed7 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Sat, 6 Aug 2016 23:19:04 +0200 Subject: x86-64-asm: Fix ltr/str and push/pop operands str accepts rm16/r32/r64, and push/pop defaults to 64 when given memory operands (to 32 on i386). --- i386-asm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'i386-asm.c') diff --git a/i386-asm.c b/i386-asm.c index 5d7ee68..dd8bb98 100644 --- a/i386-asm.c +++ b/i386-asm.c @@ -869,6 +869,9 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode) if ((opcode == TOK_ASM_push || opcode == TOK_ASM_pop) && (ops[0].type & (OP_SEG | OP_IM8S | OP_IM32))) s = 2; + else if ((opcode == TOK_ASM_push || opcode == TOK_ASM_pop) && + (ops[0].type & OP_EA)) + s = NBWLX - 2; else tcc_error("cannot infer opcode suffix"); } -- cgit v1.3.1