]> granicus.if.org Git - yasm/commitdiff
Fix push in 64-bit mode to take a 32-bit signed immediate rather than a
authorPeter Johnson <peter@tortall.net>
Tue, 16 Mar 2004 08:26:19 +0000 (08:26 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 16 Mar 2004 08:26:19 +0000 (08:26 -0000)
64-bit immediate.  Actually, whether it's signed or unsigned seems to be
uncertain; AMD64 documentation shows it as signed, but Intel's new IA-32e
says it's unsigned!  While we're here, the Imm8 version is signed, not
unsigned.

Bugzilla bug: 30
Reported by: Michael Ryan <michaelryan@mindspring.com>

svn path=/trunk/yasm/; revision=1105

modules/arch/x86/tests/Makefile.inc
modules/arch/x86/tests/push64.asm [new file with mode: 0644]
modules/arch/x86/tests/push64.errwarn [new file with mode: 0644]
modules/arch/x86/tests/push64.hex [new file with mode: 0644]
modules/arch/x86/x86id.re

index 9a78b067b4e7895143a8bbea581bcba54d6fee40..a68358c94a9eea6cdfa36420a0c453f701210d5b 100644 (file)
@@ -98,6 +98,9 @@ EXTRA_DIST += modules/arch/x86/tests/overflow.hex
 EXTRA_DIST += modules/arch/x86/tests/pshift.asm
 EXTRA_DIST += modules/arch/x86/tests/pshift.errwarn
 EXTRA_DIST += modules/arch/x86/tests/pshift.hex
+EXTRA_DIST += modules/arch/x86/tests/push64.asm
+EXTRA_DIST += modules/arch/x86/tests/push64.errwarn
+EXTRA_DIST += modules/arch/x86/tests/push64.hex
 EXTRA_DIST += modules/arch/x86/tests/rep.asm
 EXTRA_DIST += modules/arch/x86/tests/rep.errwarn
 EXTRA_DIST += modules/arch/x86/tests/rep.hex
diff --git a/modules/arch/x86/tests/push64.asm b/modules/arch/x86/tests/push64.asm
new file mode 100644 (file)
index 0000000..fc863b7
--- /dev/null
@@ -0,0 +1,4 @@
+[bits 64]
+push dword 50
+push dword -1
+push dword 1000000000000
diff --git a/modules/arch/x86/tests/push64.errwarn b/modules/arch/x86/tests/push64.errwarn
new file mode 100644 (file)
index 0000000..6a622a9
--- /dev/null
@@ -0,0 +1 @@
+-:4: warning: value does not fit in 32 bit field
diff --git a/modules/arch/x86/tests/push64.hex b/modules/arch/x86/tests/push64.hex
new file mode 100644 (file)
index 0000000..c9627ad
--- /dev/null
@@ -0,0 +1,15 @@
+68 
+32 
+00 
+00 
+00 
+68 
+ff 
+ff 
+ff 
+ff 
+68 
+00 
+10 
+a5 
+d4 
index ecad2ab63ee3e25393718425cd267d2537e0f878..97fe80a4043745d976c9124bf682ea009cb6816f 100644 (file)
@@ -441,13 +441,13 @@ static const x86_insn_info push_insn[] = {
     { CPU_Hammer|CPU_64, 0, 0, 64, 0, 1, {0xFF, 0, 0}, 6, 1,
       {OPT_RM|OPS_64|OPA_EA, 0, 0} },
     { CPU_Any, 0, 0, 64, 0, 1, {0x6A, 0, 0}, 0, 1,
-      {OPT_Imm|OPS_8|OPA_Imm, 0, 0} },
+      {OPT_Imm|OPS_8|OPA_SImm, 0, 0} },
     { CPU_Any, 0, 16, 64, 0, 1, {0x68, 0, 0}, 0, 1,
       {OPT_Imm|OPS_16|OPA_Imm, 0, 0} },
     { CPU_386|CPU_Not64, 0, 32, 0, 0, 1, {0x68, 0, 0}, 0, 1,
       {OPT_Imm|OPS_32|OPA_Imm, 0, 0} },
     { CPU_Hammer|CPU_64, 0, 64, 64, 0, 1, {0x68, 0, 0}, 0, 1,
-      {OPT_Imm|OPS_64|OPA_Imm, 0, 0} },
+      {OPT_Imm|OPS_32|OPA_SImm, 0, 0} },
     { CPU_Not64, 0, 0, 0, 0, 1, {0x0E, 0, 0}, 0, 1,
       {OPT_CS|OPS_Any|OPA_None, 0, 0} },
     { CPU_Not64, 0, 16, 0, 0, 1, {0x0E, 0, 0}, 0, 1,