From fda344ece8fca0c67780aa1c653899afc2c743aa Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Wed, 1 Dec 2004 15:45:34 +0000 Subject: [PATCH] Complete backport of i386 RC4 assembler module from HEAD. --- crypto/perlasm/x86asm.pl | 2 ++ crypto/perlasm/x86ms.pl | 1 + crypto/perlasm/x86nasm.pl | 1 + crypto/perlasm/x86unix.pl | 5 +++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl index 1cb96e914a..bef2667079 100644 --- a/crypto/perlasm/x86asm.pl +++ b/crypto/perlasm/x86asm.pl @@ -124,4 +124,6 @@ BSDI - a.out with a very primative version of as. EOF } +sub main'align() {} # swallow align statements in 0.9.7 context + 1; diff --git a/crypto/perlasm/x86ms.pl b/crypto/perlasm/x86ms.pl index fbb4afb9bd..b6bd744057 100644 --- a/crypto/perlasm/x86ms.pl +++ b/crypto/perlasm/x86ms.pl @@ -160,6 +160,7 @@ sub main'not { &out1("not",@_); } sub main'call { &out1("call",($_[0]=~/^\$L/?'':'_').$_[0]); } sub main'ret { &out0("ret"); } sub main'nop { &out0("nop"); } +sub main'movz { &out2("movzx",@_); } sub out2 { diff --git a/crypto/perlasm/x86nasm.pl b/crypto/perlasm/x86nasm.pl index 30346af4ea..502f155dd1 100644 --- a/crypto/perlasm/x86nasm.pl +++ b/crypto/perlasm/x86nasm.pl @@ -169,6 +169,7 @@ sub main'not { &out1("not",@_); } sub main'call { &out1("call",($_[0]=~/^\$L/?'':'_').$_[0]); } sub main'ret { &out0("ret"); } sub main'nop { &out0("nop"); } +sub main'movz { &out2("movzx",@_); } sub out2 { diff --git a/crypto/perlasm/x86unix.pl b/crypto/perlasm/x86unix.pl index 10b669bf04..c0cba05b07 100644 --- a/crypto/perlasm/x86unix.pl +++ b/crypto/perlasm/x86unix.pl @@ -137,7 +137,7 @@ sub main'shl { &out2("sall",@_); } sub main'shr { &out2("shrl",@_); } sub main'xor { &out2("xorl",@_); } sub main'xorb { &out2("xorb",@_); } -sub main'add { &out2("addl",@_); } +sub main'add { &out2($_[0]=~/%[a-d][lh]/?"addb":"addl",@_); } sub main'adc { &out2("adcl",@_); } sub main'sub { &out2("subl",@_); } sub main'rotl { &out2("roll",@_); } @@ -164,7 +164,7 @@ sub main'jc { &out1("jc",@_); } sub main'jnc { &out1("jnc",@_); } sub main'jno { &out1("jno",@_); } sub main'dec { &out1("decl",@_); } -sub main'inc { &out1("incl",@_); } +sub main'inc { &out1($_[0]=~/%[a-d][hl]/?"incb":"incl",@_); } sub main'push { &out1("pushl",@_); $stack+=4; } sub main'pop { &out1("popl",@_); $stack-=4; } sub main'pushf { &out0("pushf"); $stack+=4; } @@ -173,6 +173,7 @@ sub main'not { &out1("notl",@_); } sub main'call { &out1("call",($_[0]=~/^\.L/?'':$under).$_[0]); } sub main'ret { &out0("ret"); } sub main'nop { &out0("nop"); } +sub main'movz { &out2("movzb",@_); } # The bswapl instruction is new for the 486. Emulate if i386. sub main'bswap -- 2.25.1