diff options
author | Andy Polyakov <appro@openssl.org> | 2002-12-14 17:54:30 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2002-12-14 17:54:30 +0000 |
commit | 270fa8aedae8595f9c95a03f019b69cffc31baee (patch) | |
tree | 36f07d5549b4411d3d12afa6044d484b9ac5503a /crypto/perlasm/x86nasm.pl | |
parent | 4329db3726ef2010e6c5760f0ebe52dd447a63fd (diff) |
DES PIC-ification. Windows companion.
Diffstat (limited to 'crypto/perlasm/x86nasm.pl')
-rw-r--r-- | crypto/perlasm/x86nasm.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/perlasm/x86nasm.pl b/crypto/perlasm/x86nasm.pl index 819151c6bc..85cb3885ec 100644 --- a/crypto/perlasm/x86nasm.pl +++ b/crypto/perlasm/x86nasm.pl @@ -98,6 +98,8 @@ sub get_mem $addr="_$addr"; } + if ($addr =~ /^.+\-.+$/) { $addr="($addr)"; } + $reg1="$regs{$reg1}" if defined($regs{$reg1}); $reg2="$regs{$reg2}" if defined($regs{$reg2}); if (($addr ne "") && ($addr ne 0)) @@ -117,6 +119,7 @@ sub get_mem { $ret.="$reg1$post]" } + $ret =~ s/\+\]/]/; # in case $addr was the only argument return($ret); } @@ -160,7 +163,7 @@ sub main'push { &out1("push",@_); $stack+=4; } sub main'pop { &out1("pop",@_); $stack-=4; } sub main'bswap { &out1("bswap",@_); &using486(); } sub main'not { &out1("not",@_); } -sub main'call { &out1("call",'_'.$_[0]); } +sub main'call { &out1("call",($_[0]=~/^\.L/?'':'_').$_[0]); } sub main'ret { &out0("ret"); } sub main'nop { &out0("nop"); } @@ -312,7 +315,7 @@ sub main'label { if (!defined($label{$_[0]})) { - $label{$_[0]}="\$${label}${_[0]}"; + $label{$_[0]}=".${label}${_[0]}"; $label++; } return($label{$_[0]}); @@ -322,7 +325,7 @@ sub main'set_label { if (!defined($label{$_[0]})) { - $label{$_[0]}="${label}${_[0]}"; + $label{$_[0]}=".${label}${_[0]}"; $label++; } push(@out,"$label{$_[0]}:\n"); |