Ticket #67 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

push imm8/imm32 - invalid combination of opcode and operands

Reported by: bird-yasm Assigned to:
Priority: P1 Milestone: 1
Component: Architecture: x86 Version: unspecified
Severity: normal Keywords:
Cc:

Description

Current svn snapshot (r1365) fails on "push 0" with the error "invalid combination of opcode and operands". It's possible to work around it by adding "byte" or "dword" in front of the imm. Nasm will generate "push dword 0".

Attachments

Change History

02/09/06 07:32:12 changed by bird-yasm

  • owner changed.
  • component changed from Core to Architecture: x86.

The following fixes the problem, don't know if it's The Right Thing (tm) though:

Index: modules/arch/x86/x86id.re
===================================================================
--- modules/arch/x86/x86id.re   (revision 1366)
+++ modules/arch/x86/x86id.re   (working copy)
@@ -626,14 +626,14 @@
       {OPT_Imm|OPS_32|OPA_Imm, 0, 0} },
     { CPU_Hammer|CPU_64, MOD_GasIllegal, 64, 64, 0, 1, {0x68, 0, 0}, 0, 1,
       {OPT_Imm|OPS_32|OPA_SImm, 0, 0} },
-    { CPU_Any, MOD_GasOnly|MOD_GasSufB, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1,
+    { CPU_Any, MOD_GasSufB, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1,
       {OPT_Imm|OPS_8|OPS_Relaxed|OPA_SImm, 0, 0} },
-    { CPU_Any, MOD_GasOnly|MOD_GasSufW, 16, 64, 0, 1, {0x68, 0x6A, 0}, 0, 1,
+    { CPU_Any, MOD_GasSufW, 16, 64, 0, 1, {0x68, 0x6A, 0}, 0, 1,
       {OPT_Imm|OPS_16|OPS_Relaxed|OPA_Imm|OPAP_SImm8Avail, 0, 0} },
-    { CPU_386|CPU_Not64, MOD_GasOnly|MOD_GasSufL, 32, 0, 0, 1,
+    { CPU_386|CPU_Not64, MOD_GasSufL, 32, 0, 0, 1,
       {0x68, 0x6A, 0}, 0, 1,
       {OPT_Imm|OPS_32|OPS_Relaxed|OPA_Imm|OPAP_SImm8Avail, 0, 0} },
-    { CPU_Hammer|CPU_64, MOD_GasOnly|MOD_GasSufQ, 64, 64, 0, 1,
+    { CPU_Hammer|CPU_64, MOD_GasSufQ, 64, 64, 0, 1,
       {0x68, 0x6A, 0}, 0, 1,
       {OPT_Imm|OPS_32|OPS_Relaxed|OPA_SImm|OPAP_SImm8Avail, 0, 0} },
     { CPU_Not64, 0, 0, 0, 0, 1, {0x0E, 0, 0}, 0, 1,

02/09/06 12:39:48 changed by bird-yasm

the first two changes wasn't the right thing at least.

02/09/06 20:25:06 changed by peter

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [1371]. Yasm will also auto-size down to 8 bits if the value fits in 8 bits. Thanks for the bug report!


Add/Change #67 (push imm8/imm32 - invalid combination of opcode and operands)