Modify ↓
Ticket #67 (closed defect: fixed)
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
Note: See
TracTickets for help on using
tickets.

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,