summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2006-10-17 06:43:11 +0000
committerAndy Polyakov <appro@openssl.org>2006-10-17 06:43:11 +0000
commitd68ff71004282eedd8faa4411187fee08f54f75f (patch)
tree461bf5330d67f2b4cb7f02ee3fb168df268af898
parent591e85e92813225cc4ed8840a636ea966f3053e8 (diff)
Support for .asciz directive in perlasm modules.
-rwxr-xr-xcrypto/perlasm/ppc-xlate.pl8
-rwxr-xr-xcrypto/perlasm/x86_64-xlate.pl8
-rw-r--r--crypto/perlasm/x86asm.pl2
3 files changed, 18 insertions, 0 deletions
diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl
index bedaa99cb4..e36b5aedb2 100755
--- a/crypto/perlasm/ppc-xlate.pl
+++ b/crypto/perlasm/ppc-xlate.pl
@@ -64,6 +64,14 @@ my $machine = sub {
}
".machine $arch";
};
+my $asciz = sub {
+ shift;
+ my $line = join(",",@_);
+ if ($line =~ /^"(.*)"$/)
+ { ".byte " . join(",",unpack("C*",$1),0); }
+ else
+ { ""; }
+};
################################################################
# simplified mnemonics not handled by at least one assembler
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
index b158f72971..4370a97b6a 100755
--- a/crypto/perlasm/x86_64-xlate.pl
+++ b/crypto/perlasm/x86_64-xlate.pl
@@ -323,6 +323,8 @@ my $current_function;
$line =~ s/\@function.*/\@function/;
if ($line =~ /\.picmeup\s+(%r[\w]+)/i) {
$self->{value} = sprintf "\t.long\t0x%x,0x90000000",$opcode{$1};
+ } elsif ($line =~ /\.asciz\s+"(.*)"$/) {
+ $self->{value} = ".byte\t".join(",",unpack("C*",$1),0);
} else {
$self->{value} = $line;
}
@@ -378,6 +380,12 @@ my $current_function;
/\.picmeup/ && do { $self->{value} = sprintf"\tDD\t 0%Xh,090000000h",$opcode{$line};
last;
};
+ /\.asciz/ && do { if ($line =~ /^"(.*)"$/) {
+ $self->{value} = "DB\t"
+ .join(",",unpack("C*",$1),0);
+ }
+ last;
+ };
}
$line = "";
}
diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl
index 24f21e17ee..7a08dbfdc5 100644
--- a/crypto/perlasm/x86asm.pl
+++ b/crypto/perlasm/x86asm.pl
@@ -94,6 +94,8 @@ sub ::function_end_A
$stack+=16; # readjust esp as if we didn't pop anything
}
+sub ::asciz { foreach (@_) { &data_byte(unpack("C*",$_[0]),0); } }
+
sub ::asm_finish
{ &file_end();
print @out;