Lots of things got in the way since March, but I've had a chance to re-look
at this issue.  I had gotten as far as creating some patches but had not
fully vetted them -- just this week I tried again and found that for the
9/10 snapshot generates with VS 2013 Express Edition MASM 64 bit without
any changes!  Wonderful!

For the 32 bit, it still had small issues, but all that was required to get
it to generate was a small variation on what is already there.  In case
there was interest in having that work I am posting what I found.  I added
a new file (new incarnation of a very old file I think) ms\do_masm.bat:

perl util\mkfiles.pl >MINFO
perl util\mk1mf.pl VC-WIN32 >ms\nt.mak
perl util\mk1mf.pl dll VC-WIN32 >ms\ntdll.mak
perl util\mk1mf.pl BC-NT >ms\bcb.mak

perl util\mkdef.pl 32 libeay > ms\libeay32.def
perl util\mkdef.pl 32 ssleay > ms\ssleay32.def


I then slightly modified the perlasm/x86masm.pl file to slightly change the
handling of XMM pointer references, and to make sure the DB/DW/DD
statements generated don't exceed MASM's buffer length and VOILA!  The MASM
assembler works for 32 bit as well!  Below are those changes.  I have not
checked with "ms\test.bat" on an advanced processor yet.

Thanks,

Steve...

--- openssl-1.0.2-stable-SNAP-20140910/crypto/perlasm/x86masm.pl 2013-05-19
16:00:12.000000000 -0400
+++ openssl-1.0.2-stable-SNAP-20140910_MASM/crypto/perlasm/x86masm.pl
2014-09-11
11:08:37.998095700 -0400
@@ -20,8 +20,14 @@
     { $opcode="mov"; }
     elsif ($opcode !~ /movq/)
     { # fix xmm references
- $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if
($arg[1]=~/\bxmm[0-7]\b/i);
- $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if
($arg[0]=~/\bxmm[0-7]\b/i);
+        my $ptrsize = 'XMMWORD';
+        if ($opcode eq 'movd') {$ptrsize = 'DWORD';}
+ $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/$ptrsize PTR/i if
($arg[1]=~/\bxmm[0-7]\b/i);
+ $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/$ptrsize PTR/i if
($arg[0]=~/\bxmm[0-7]\b/i);
+ if (defined($arg[2])) {
+ $arg[2] =~ s/\b[A-Z]+WORD\s+PTR/$ptrsize PTR/i if
($arg[1]=~/\bxmm[0-7]\b/i);
+ $arg[2] =~ s/\b[A-Z]+WORD\s+PTR/$ptrsize PTR/i if
($arg[0]=~/\bxmm[0-7]\b/i);
+ }
     }

     &::emit($opcode,@arg);
@@ -160,13 +166,13 @@
 {   push(@out,"PUBLIC\t".&::LABEL($_[0],$nmdecor.$_[0])."\n");   }

 sub ::data_byte
-{   push(@out,("DB\t").join(',',@_)."\n"); }
+{   push @out, (("DB\t").join(',',splice(@_, 0, 16))."\n") while @_; }

 sub ::data_short
-{   push(@out,("DW\t").join(',',@_)."\n"); }
+{   push @out, (("DW\t").join(',',splice(@_, 0, 8))."\n") while @_; }

 sub ::data_word
-{   push(@out,("DD\t").join(',',@_)."\n"); }
+{   push @out, (("DD\t").join(',',splice(@_, 0, 4))."\n") while @_; }

 sub ::align
 {   push(@out,"ALIGN\t$_[0]\n"); }


On Fri, Mar 7, 2014 at 10:12 AM, Steven Kneizys <sknei...@ferrilli.com>
wrote:

> >> Quick question on 1.0.2 and Visual Studio win64 builds ... is ml64
> >> supported or just nasm?
>
> >Quick answer: quantum mechanics. Longer answer: state is unknown till
> >it's measured. Long answer: reports are not rejected, but
> >when-in-doubt-use-nasm principle applies, and reaction to reports can as
> >well be avoiding problem.
>
> Well then I will definitely send in my more complete analysis/proposed
> fixes.
> ....
>



-- 
Steve Kneizys
Senior Business Process Engineer
Voice: (610) 256-1396  [For Emergency Service (888)864-3282]
Ferrilli Information Group -- Quality Service and Solutions for Higher
Education
web: http://www.ferrilli.com/ <http://www.figsolutions.com/>

Making you a success while exceeding your expectations.
--- openssl-1.0.2-stable-SNAP-20140910/crypto/perlasm/x86masm.pl        
2013-05-19 16:00:12.000000000 -0400
+++ openssl-1.0.2-stable-SNAP-20140910_MASM/crypto/perlasm/x86masm.pl   
2014-09-11 11:08:37.998095700 -0400
@@ -20,8 +20,14 @@
     {  $opcode="mov";  }
     elsif ($opcode !~ /movq/)
     {  # fix xmm references
-       $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if 
($arg[1]=~/\bxmm[0-7]\b/i);
-       $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if 
($arg[0]=~/\bxmm[0-7]\b/i);
+        my $ptrsize = 'XMMWORD';
+        if ($opcode eq 'movd') {$ptrsize = 'DWORD';}
+       $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/$ptrsize PTR/i if 
($arg[1]=~/\bxmm[0-7]\b/i);
+       $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/$ptrsize PTR/i if 
($arg[0]=~/\bxmm[0-7]\b/i);
+       if (defined($arg[2])) {
+               $arg[2] =~ s/\b[A-Z]+WORD\s+PTR/$ptrsize PTR/i if 
($arg[1]=~/\bxmm[0-7]\b/i);
+               $arg[2] =~ s/\b[A-Z]+WORD\s+PTR/$ptrsize PTR/i if 
($arg[0]=~/\bxmm[0-7]\b/i);
+       }
     }
 
     &::emit($opcode,@arg);
@@ -160,13 +166,13 @@
 {   push(@out,"PUBLIC\t".&::LABEL($_[0],$nmdecor.$_[0])."\n");   }
 
 sub ::data_byte
-{   push(@out,("DB\t").join(',',@_)."\n");     }
+{   push @out, (("DB\t").join(',',splice(@_, 0, 16))."\n") while @_; }
 
 sub ::data_short
-{   push(@out,("DW\t").join(',',@_)."\n");     }
+{   push @out, (("DW\t").join(',',splice(@_, 0, 8))."\n") while @_; }
 
 sub ::data_word
-{   push(@out,("DD\t").join(',',@_)."\n");     }
+{   push @out, (("DD\t").join(',',splice(@_, 0, 4))."\n") while @_; }
 
 sub ::align
 {   push(@out,"ALIGN\t$_[0]\n");       }

Reply via email to