mirror of https://github.com/yasm/yasm.git
Fix #67 by autosizing push immediate with no specified size to either 8 bit
or the current BITS-derived operation size. * x86id.re (OPS_BITS): New match rule for size == BITS setting. (push_insn): Use OPS_BITS for 16-bit/32-bit mode, and reuse GAS rule for 64-bit mode. (yasm_x86__finalize_insn): Set size_lookup[7] to BITS setting. Set opersize based on this value if OPS_BITS is used. * pushnosize.asm: New test for push imm, both sized and unsized, in all BITS modes. svn path=/trunk/yasm/; revision=13710.5.0rc2
parent
29b0319135
commit
035139d614
5 changed files with 133 additions and 2 deletions
@ -0,0 +1,29 @@ |
||||
[bits 16] |
||||
push 0 ; 6A 00 - equivalent to push byte 0 |
||||
push byte 0 ; 6A 00 |
||||
push word 0 ; 68 0000 |
||||
push dword 0 ; 66 68 00000000 |
||||
push 128 ; 68 8000 - doesn't fit in byte, equivalent to push word 128 |
||||
push byte 128 ; 6A 80 - warning (signed overflow) |
||||
push word 128 ; 68 8000 |
||||
push dword 128 ; 66 68 80000000 |
||||
|
||||
[bits 32] |
||||
push 0 ; 6A 00 - equivalent to push byte 0 |
||||
push byte 0 ; 6A 00 |
||||
push word 0 ; 66 68 0000 |
||||
push dword 0 ; 68 00000000 |
||||
push 128 ; 68 80000000 - doesn't fit in byte -> push dword 128 |
||||
push byte 128 ; 6A 80 - warning (signed overflow) |
||||
push word 128 ; 66 6A 8000 |
||||
push dword 128 ; 6A 80000000 |
||||
|
||||
[bits 64] |
||||
push 0 ; same as bits 32 output |
||||
push byte 0 |
||||
push word 0 |
||||
push dword 0 |
||||
push 128 |
||||
push byte 128 ; warning |
||||
push word 128 |
||||
push dword 128 |
@ -0,0 +1,3 @@ |
||||
-:7: warning: value does not fit in signed 8 bit field |
||||
-:17: warning: value does not fit in signed 8 bit field |
||||
-:27: warning: value does not fit in signed 8 bit field |
@ -0,0 +1,85 @@ |
||||
6a |
||||
00 |
||||
6a |
||||
00 |
||||
68 |
||||
00 |
||||
00 |
||||
66 |
||||
68 |
||||
00 |
||||
00 |
||||
00 |
||||
00 |
||||
68 |
||||
80 |
||||
00 |
||||
6a |
||||
80 |
||||
68 |
||||
80 |
||||
00 |
||||
66 |
||||
68 |
||||
80 |
||||
00 |
||||
00 |
||||
00 |
||||
6a |
||||
00 |
||||
6a |
||||
00 |
||||
66 |
||||
68 |
||||
00 |
||||
00 |
||||
68 |
||||
00 |
||||
00 |
||||
00 |
||||
00 |
||||
68 |
||||
80 |
||||
00 |
||||
00 |
||||
00 |
||||
6a |
||||
80 |
||||
66 |
||||
68 |
||||
80 |
||||
00 |
||||
68 |
||||
80 |
||||
00 |
||||
00 |
||||
00 |
||||
6a |
||||
00 |
||||
6a |
||||
00 |
||||
66 |
||||
68 |
||||
00 |
||||
00 |
||||
68 |
||||
00 |
||||
00 |
||||
00 |
||||
00 |
||||
68 |
||||
80 |
||||
00 |
||||
00 |
||||
00 |
||||
6a |
||||
80 |
||||
66 |
||||
68 |
||||
80 |
||||
00 |
||||
68 |
||||
80 |
||||
00 |
||||
00 |
||||
00 |
Loading…
Reference in new issue