aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/conf-w32brg/mpi/nasm586/mpih-mul1.asm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/conf-w32brg/mpi/nasm586/mpih-mul1.asm')
-rw-r--r--scripts/conf-w32brg/mpi/nasm586/mpih-mul1.asm70
1 files changed, 70 insertions, 0 deletions
diff --git a/scripts/conf-w32brg/mpi/nasm586/mpih-mul1.asm b/scripts/conf-w32brg/mpi/nasm586/mpih-mul1.asm
new file mode 100644
index 000000000..b00fbe3a7
--- /dev/null
+++ b/scripts/conf-w32brg/mpi/nasm586/mpih-mul1.asm
@@ -0,0 +1,70 @@
+
+; i80586 mul_1 -- Multiply a limb vector with a limb and store the
+; result in a second limb vector.
+;
+; Copyright (C) 1992, 1994, 1995, 1996, 1998,
+; 2001 Free Software Foundation, Inc.
+;
+; This file is part of GnuPG.
+;
+; GnuPG is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; GnuPG is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+; GNU General Public License for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with this program; if not, write to the Free Software
+; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+;
+; Modified versions of the GPG i586 assembler for use with NASM. This
+; file is part of a native port of Gnu PG for use with Microsoft Visual
+; Studio .net. Ported by Brian Gladman <[email protected]> March 2002.
+
+%define res_ptr edi
+%define s1_ptr esi
+%define size ecx
+%define s2_limb ebp
+
+ global _mpihelp_mul_1
+
+ section .text
+ align 8
+
+_mpihelp_mul_1:
+ push edi
+ push esi
+ push ebx
+ push ebp
+ mov res_ptr,[esp+20]
+ mov s1_ptr,[esp+24]
+ mov size,[esp+28]
+ mov s2_limb,[esp+32]
+ lea res_ptr,[res_ptr+size*4]
+ lea s1_ptr,[s1_ptr+size*4]
+ neg size
+ xor ebx,ebx
+
+ align 8
+.1:
+ adc ebx,0
+ mov eax,[s1_ptr+size*4]
+ mul s2_limb
+ add ebx,eax
+ mov [res_ptr+size*4],ebx
+ inc size
+ mov ebx,edx
+ jnz short .1
+ adc ebx,0
+ mov eax,ebx
+ pop ebp
+ pop ebx
+ pop esi
+ pop edi
+ ret
+
+ end