More NASM support code it still doesn't work but it doesn't work less than it
authorDr. Stephen Henson <steve@openssl.org>
Mon, 12 Jul 1999 18:12:43 +0000 (18:12 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 12 Jul 1999 18:12:43 +0000 (18:12 +0000)
didn't work before :-)

crypto/des/asm/crypt586.pl
crypto/des/asm/desboth.pl
crypto/perlasm/x86ms.pl
crypto/perlasm/x86nasm.pl
crypto/perlasm/x86unix.pl
ms/x86asm.bat [new file with mode: 0755]
util/mk1mf.pl
util/pl/VC-32.pl

index b310d92..197c413 100644 (file)
@@ -32,7 +32,7 @@ sub fcrypt_body
        &xor(   $R,     $R);
        &mov($ks,&wparam(1));
 
-       &push(25); # add a variable
+       &push(&DWC(25)); # add a variable
 
        &set_label("start");
        for ($i=0; $i<16; $i+=2)
index 288984d..d510641 100644 (file)
@@ -44,15 +44,15 @@ sub des_encrypt3
                 &mov("edi",&wparam(2));
                 &mov("eax",&wparam(3));
                }
-       &mov(&swtmp(2), (($enc)?"1":"0"));
+       &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
        &mov(&swtmp(1), "eax");
        &mov(&swtmp(0), "ebx");
        &call("des_encrypt2");
-       &mov(&swtmp(2), (($enc)?"0":"1"));
+       &mov(&swtmp(2), (DWC(($enc)?"0":"1")));
        &mov(&swtmp(1), "edi");
        &mov(&swtmp(0), "ebx");
        &call("des_encrypt2");
-       &mov(&swtmp(2), (($enc)?"1":"0"));
+       &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
        &mov(&swtmp(1), "esi");
        &mov(&swtmp(0), "ebx");
        &call("des_encrypt2");
index b8b1909..51dcce0 100644 (file)
@@ -51,6 +51,16 @@ sub main'DWP
        &get_mem("DWORD",@_);
        }
 
+sub main'BC
+       {
+       return @_;
+       }
+
+sub main'DWC
+       {
+       return @_;
+       }
+
 sub main'stack_push
        {
        local($num)=@_;
index 3aab34a..b4da364 100644 (file)
@@ -27,7 +27,14 @@ $label="L000";
 sub main'asm_init_output { @out=(); }
 sub main'asm_get_output { return(@out); }
 sub main'get_labels { return(@labels); }
-sub main'external_label { push(@labels,@_); push(@out, "EXTERN\t$_[0]"); }
+
+sub main'external_label
+{
+       push(@labels,@_);
+       foreach (@_) {
+               push(@out, "extern\t_$_\n");
+       }
+}
 
 sub main'LB
        {
@@ -51,6 +58,16 @@ sub main'DWP
        &get_mem("DWORD",@_);
        }
 
+sub main'BC
+       {
+       return "BYTE @_";
+       }
+
+sub main'DWC
+       {
+       return "DWORD @_";
+       }
+
 sub main'stack_push
        {
        my($num)=@_;
@@ -69,7 +86,7 @@ sub get_mem
        {
        my($size,$addr,$reg1,$reg2,$idx)=@_;
        my($t,$post);
-       my($ret)="[$size ";
+       my($ret)="[";
        $addr =~ s/^\s+//;
        if ($addr =~ /^(.+)\+(.+)$/)
                {
@@ -192,7 +209,7 @@ sub using486
 
 sub main'file
        {
-       push(@out, "segment .text");
+       push(@out, "segment .text\n");
        }
 
 sub main'function_begin
@@ -201,7 +218,7 @@ sub main'function_begin
 
        push(@labels,$func);
        my($tmp)=<<"EOF";
-GLOBAL _$func
+global _$func
 _$func:
        push    ebp
        push    ebx
@@ -216,7 +233,7 @@ sub main'function_begin_B
        {
        my($func,$extra)=@_;
        my($tmp)=<<"EOF";
-GLOBAL _$func
+global _$func
 _$func:
 EOF
        push(@out,$tmp);
index bc9e42e..8c456b1 100644 (file)
@@ -100,6 +100,16 @@ sub main'BP
        return(&main'DWP(@_));
        }
 
+sub main'BC
+       {
+       return @_;
+       }
+
+sub main'DWC
+       {
+       return @_;
+       }
+
 #sub main'BP
 #      {
 #      local($addr,$reg1,$reg2,$idx)=@_;
diff --git a/ms/x86asm.bat b/ms/x86asm.bat
new file mode 100755 (executable)
index 0000000..4d80e70
--- /dev/null
@@ -0,0 +1,57 @@
+\r
+@echo off\r
+echo Generating x86 assember\r
+\r
+echo Bignum\r
+cd crypto\bn\asm\r
+perl x86.pl win32n > bn-win32.asm\r
+cd ..\..\..\r
+\r
+echo DES\r
+cd crypto\des\asm\r
+perl des-586.pl win32n > d-win32.asm\r
+cd ..\..\..\r
+\r
+echo "crypt(3)"\r
+\r
+cd crypto\des\asm\r
+perl crypt586.pl win32n > y-win32.asm\r
+cd ..\..\..\r
+\r
+echo Blowfish\r
+\r
+cd crypto\bf\asm\r
+perl bf-586.pl win32n > b-win32.asm\r
+cd ..\..\..\r
+\r
+echo CAST5\r
+cd crypto\cast\asm\r
+perl cast-586.pl win32n > c-win32.asm\r
+cd ..\..\..\r
+\r
+echo RC4\r
+cd crypto\rc4\asm\r
+perl rc4-586.pl win32n > r4-win32.asm\r
+cd ..\..\..\r
+\r
+echo MD5\r
+cd crypto\md5\asm\r
+perl md5-586.pl win32n > m5-win32.asm\r
+cd ..\..\..\r
+\r
+echo SHA1\r
+cd crypto\sha\asm\r
+perl sha1-586.pl win32n > s1-win32.asm\r
+cd ..\..\..\r
+\r
+echo RIPEMD160\r
+cd crypto\ripemd\asm\r
+perl rmd-586.pl win32n > rm-win32.asm\r
+cd ..\..\..\r
+\r
+echo RC5\32\r
+cd crypto\rc5\asm\r
+perl rc5-586.pl win32n > r5-win32.asm\r
+cd ..\..\..\r
+\r
+echo on\r
index c9b5b2c..0afc3c6 100755 (executable)
@@ -58,6 +58,7 @@ and [options] can be one of
        no-ssl2 no-ssl3                         - Skip this version of SSL
        just-ssl                                - remove all non-ssl keys/digest
        no-asm                                  - No x86 asm
+       nasm                                    - Use NASM for x86 asm
        no-socks                                - No socket code
        no-err                                  - No error strings
        dll/shlib                               - Build shared libraries (MS)
@@ -813,6 +814,7 @@ sub read_options
        elsif (/^no-dh$/)       { $no_dh=1; }
        elsif (/^no-hmac$/)     { $no_hmac=1; }
        elsif (/^no-asm$/)      { $no_asm=1; }
+       elsif (/^nasm$/)        { $nasm=1; }
        elsif (/^no-ssl2$/)     { $no_ssl2=1; }
        elsif (/^no-ssl3$/)     { $no_ssl3=1; }
        elsif (/^no-err$/)      { $no_err=1; }
index 8082d2e..6db1c9f 100644 (file)
@@ -49,10 +49,14 @@ $lfile='/out:';
 
 $shlib_ex_obj="";
 $app_ex_obj="setargv.obj";
-
-$asm='ml /Cp /coff /c /Cx';
-$asm.=" /Zi" if $debug;
-$afile='/Fo';
+if ($nasm) {
+       $asm='nasmw -f win32';
+       $afile='-o ';
+} else {
+       $asm='ml /Cp /coff /c /Cx';
+       $asm.=" /Zi" if $debug;
+       $afile='/Fo';
+}
 
 $bn_asm_obj='';
 $bn_asm_src='';