#67 (push imm8/imm32 - invalid combination of opcode and operands) – The Yasm Modular Assembler Project
Modify

Ticket #67 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

push imm8/imm32 - invalid combination of opcode and operands

Reported by: bird-yasm@… Owned by:
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

comment:1 Changed 4 years ago by bird-yasm@…

  • 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,

comment:2 Changed 4 years ago by bird-yasm@…

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

comment:3 Changed 4 years ago 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!

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.