1 %ifidn __OUTPUT_FORMAT__
,obj
2 section code use32 class
=code
align=64
3 %elifidn __OUTPUT_FORMAT__
,win32
4 %ifdef __YASM_VERSION_ID__
5 %if __YASM_VERSION_ID__
< 01010000h
6 %error yasm version
1.1.0 or later needed.
8 ; Yasm automatically includes .00 and complains about redefining it.
9 ; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
13 section .text code
align=64
17 global _bn_mul_add_words
20 L$
_bn_mul_add_words_begin:
27 mov edi,DWORD [20+esp]
28 mov ecx,DWORD [28+esp]
29 mov ebx,DWORD [24+esp]
31 mov ebp,DWORD [32+esp]
33 jz NEAR L
$000maw_finish
64 mov eax,DWORD [12+ebx]
68 add eax,DWORD [12+edi]
70 mov DWORD [12+edi],eax
73 mov eax,DWORD [16+ebx]
77 add eax,DWORD [16+edi]
79 mov DWORD [16+edi],eax
82 mov eax,DWORD [20+ebx]
86 add eax,DWORD [20+edi]
88 mov DWORD [20+edi],eax
91 mov eax,DWORD [24+ebx]
95 add eax,DWORD [24+edi]
97 mov DWORD [24+edi],eax
100 mov eax,DWORD [28+ebx]
104 add eax,DWORD [28+edi]
106 mov DWORD [28+edi],eax
112 jnz NEAR L
$001maw_loop
114 mov ecx,DWORD [32+esp]
116 jnz NEAR L
$002maw_finish2
117 jmp NEAR L
$003maw_end
131 mov eax,DWORD [4+ebx]
135 add eax,DWORD [4+edi]
138 mov DWORD [4+edi],eax
142 mov eax,DWORD [8+ebx]
146 add eax,DWORD [8+edi]
149 mov DWORD [8+edi],eax
153 mov eax,DWORD [12+ebx]
157 add eax,DWORD [12+edi]
160 mov DWORD [12+edi],eax
164 mov eax,DWORD [16+ebx]
168 add eax,DWORD [16+edi]
171 mov DWORD [16+edi],eax
175 mov eax,DWORD [20+ebx]
179 add eax,DWORD [20+edi]
182 mov DWORD [20+edi],eax
186 mov eax,DWORD [24+ebx]
190 add eax,DWORD [24+edi]
192 mov DWORD [24+edi],eax
205 L$
_bn_mul_words_begin:
212 mov edi,DWORD [20+esp]
213 mov ebx,DWORD [24+esp]
214 mov ebp,DWORD [28+esp]
215 mov ecx,DWORD [32+esp]
217 jz NEAR L
$004mw_finish
227 mov eax,DWORD [4+ebx]
231 mov DWORD [4+edi],eax
234 mov eax,DWORD [8+ebx]
238 mov DWORD [8+edi],eax
241 mov eax,DWORD [12+ebx]
245 mov DWORD [12+edi],eax
248 mov eax,DWORD [16+ebx]
252 mov DWORD [16+edi],eax
255 mov eax,DWORD [20+ebx]
259 mov DWORD [20+edi],eax
262 mov eax,DWORD [24+ebx]
266 mov DWORD [24+edi],eax
269 mov eax,DWORD [28+ebx]
273 mov DWORD [28+edi],eax
279 jz NEAR L
$004mw_finish
280 jmp NEAR L
$005mw_loop
282 mov ebp,DWORD [28+esp]
284 jnz NEAR L
$006mw_finish2
297 mov eax,DWORD [4+ebx]
301 mov DWORD [4+edi],eax
306 mov eax,DWORD [8+ebx]
310 mov DWORD [8+edi],eax
315 mov eax,DWORD [12+ebx]
319 mov DWORD [12+edi],eax
324 mov eax,DWORD [16+ebx]
328 mov DWORD [16+edi],eax
333 mov eax,DWORD [20+ebx]
337 mov DWORD [20+edi],eax
342 mov eax,DWORD [24+ebx]
346 mov DWORD [24+edi],eax
358 L$
_bn_sqr_words_begin:
364 mov esi,DWORD [20+esp]
365 mov edi,DWORD [24+esp]
366 mov ebx,DWORD [28+esp]
368 jz NEAR L
$008sw_finish
374 mov DWORD [4+esi],edx
376 mov eax,DWORD [4+edi]
378 mov DWORD [8+esi],eax
379 mov DWORD [12+esi],edx
381 mov eax,DWORD [8+edi]
383 mov DWORD [16+esi],eax
384 mov DWORD [20+esi],edx
386 mov eax,DWORD [12+edi]
388 mov DWORD [24+esi],eax
389 mov DWORD [28+esi],edx
391 mov eax,DWORD [16+edi]
393 mov DWORD [32+esi],eax
394 mov DWORD [36+esi],edx
396 mov eax,DWORD [20+edi]
398 mov DWORD [40+esi],eax
399 mov DWORD [44+esi],edx
401 mov eax,DWORD [24+edi]
403 mov DWORD [48+esi],eax
404 mov DWORD [52+esi],edx
406 mov eax,DWORD [28+edi]
408 mov DWORD [56+esi],eax
409 mov DWORD [60+esi],edx
414 jnz NEAR L
$009sw_loop
416 mov ebx,DWORD [28+esp]
424 mov DWORD [4+esi],edx
427 mov eax,DWORD [4+edi]
429 mov DWORD [8+esi],eax
431 mov DWORD [12+esi],edx
434 mov eax,DWORD [8+edi]
436 mov DWORD [16+esi],eax
438 mov DWORD [20+esi],edx
441 mov eax,DWORD [12+edi]
443 mov DWORD [24+esi],eax
445 mov DWORD [28+esi],edx
448 mov eax,DWORD [16+edi]
450 mov DWORD [32+esi],eax
452 mov DWORD [36+esi],edx
455 mov eax,DWORD [20+edi]
457 mov DWORD [40+esi],eax
459 mov DWORD [44+esi],edx
462 mov eax,DWORD [24+edi]
464 mov DWORD [48+esi],eax
465 mov DWORD [52+esi],edx
475 L$
_bn_div_words_begin:
476 mov edx,DWORD [4+esp]
477 mov eax,DWORD [8+esp]
478 mov ecx,DWORD [12+esp]
484 L$
_bn_add_words_begin:
490 mov ebx,DWORD [20+esp]
491 mov esi,DWORD [24+esp]
492 mov edi,DWORD [28+esp]
493 mov ebp,DWORD [32+esp]
496 jz NEAR L
$011aw_finish
508 mov ecx,DWORD [4+esi]
509 mov edx,DWORD [4+edi]
515 mov DWORD [4+ebx],ecx
517 mov ecx,DWORD [8+esi]
518 mov edx,DWORD [8+edi]
524 mov DWORD [8+ebx],ecx
526 mov ecx,DWORD [12+esi]
527 mov edx,DWORD [12+edi]
533 mov DWORD [12+ebx],ecx
535 mov ecx,DWORD [16+esi]
536 mov edx,DWORD [16+edi]
542 mov DWORD [16+ebx],ecx
544 mov ecx,DWORD [20+esi]
545 mov edx,DWORD [20+edi]
551 mov DWORD [20+ebx],ecx
553 mov ecx,DWORD [24+esi]
554 mov edx,DWORD [24+edi]
560 mov DWORD [24+ebx],ecx
562 mov ecx,DWORD [28+esi]
563 mov edx,DWORD [28+edi]
569 mov DWORD [28+ebx],ecx
575 jnz NEAR L
$012aw_loop
577 mov ebp,DWORD [32+esp]
592 mov ecx,DWORD [4+esi]
593 mov edx,DWORD [4+edi]
600 mov DWORD [4+ebx],ecx
603 mov ecx,DWORD [8+esi]
604 mov edx,DWORD [8+edi]
611 mov DWORD [8+ebx],ecx
614 mov ecx,DWORD [12+esi]
615 mov edx,DWORD [12+edi]
622 mov DWORD [12+ebx],ecx
625 mov ecx,DWORD [16+esi]
626 mov edx,DWORD [16+edi]
633 mov DWORD [16+ebx],ecx
636 mov ecx,DWORD [20+esi]
637 mov edx,DWORD [20+edi]
644 mov DWORD [20+ebx],ecx
647 mov ecx,DWORD [24+esi]
648 mov edx,DWORD [24+edi]
654 mov DWORD [24+ebx],ecx
664 L$
_bn_sub_words_begin:
670 mov ebx,DWORD [20+esp]
671 mov esi,DWORD [24+esp]
672 mov edi,DWORD [28+esp]
673 mov ebp,DWORD [32+esp]
676 jz NEAR L
$014aw_finish
688 mov ecx,DWORD [4+esi]
689 mov edx,DWORD [4+edi]
695 mov DWORD [4+ebx],ecx
697 mov ecx,DWORD [8+esi]
698 mov edx,DWORD [8+edi]
704 mov DWORD [8+ebx],ecx
706 mov ecx,DWORD [12+esi]
707 mov edx,DWORD [12+edi]
713 mov DWORD [12+ebx],ecx
715 mov ecx,DWORD [16+esi]
716 mov edx,DWORD [16+edi]
722 mov DWORD [16+ebx],ecx
724 mov ecx,DWORD [20+esi]
725 mov edx,DWORD [20+edi]
731 mov DWORD [20+ebx],ecx
733 mov ecx,DWORD [24+esi]
734 mov edx,DWORD [24+edi]
740 mov DWORD [24+ebx],ecx
742 mov ecx,DWORD [28+esi]
743 mov edx,DWORD [28+edi]
749 mov DWORD [28+ebx],ecx
755 jnz NEAR L
$015aw_loop
757 mov ebp,DWORD [32+esp]
772 mov ecx,DWORD [4+esi]
773 mov edx,DWORD [4+edi]
780 mov DWORD [4+ebx],ecx
783 mov ecx,DWORD [8+esi]
784 mov edx,DWORD [8+edi]
791 mov DWORD [8+ebx],ecx
794 mov ecx,DWORD [12+esi]
795 mov edx,DWORD [12+edi]
802 mov DWORD [12+ebx],ecx
805 mov ecx,DWORD [16+esi]
806 mov edx,DWORD [16+edi]
813 mov DWORD [16+ebx],ecx
816 mov ecx,DWORD [20+esi]
817 mov edx,DWORD [20+edi]
824 mov DWORD [20+ebx],ecx
827 mov ecx,DWORD [24+esi]
828 mov edx,DWORD [24+edi]
834 mov DWORD [24+ebx],ecx
841 global _bn_sub_part_words
844 L$
_bn_sub_part_words_begin:
850 mov ebx,DWORD [20+esp]
851 mov esi,DWORD [24+esp]
852 mov edi,DWORD [28+esp]
853 mov ebp,DWORD [32+esp]
856 jz NEAR L
$017aw_finish
868 mov ecx,DWORD [4+esi]
869 mov edx,DWORD [4+edi]
875 mov DWORD [4+ebx],ecx
877 mov ecx,DWORD [8+esi]
878 mov edx,DWORD [8+edi]
884 mov DWORD [8+ebx],ecx
886 mov ecx,DWORD [12+esi]
887 mov edx,DWORD [12+edi]
893 mov DWORD [12+ebx],ecx
895 mov ecx,DWORD [16+esi]
896 mov edx,DWORD [16+edi]
902 mov DWORD [16+ebx],ecx
904 mov ecx,DWORD [20+esi]
905 mov edx,DWORD [20+edi]
911 mov DWORD [20+ebx],ecx
913 mov ecx,DWORD [24+esi]
914 mov edx,DWORD [24+edi]
920 mov DWORD [24+ebx],ecx
922 mov ecx,DWORD [28+esi]
923 mov edx,DWORD [28+edi]
929 mov DWORD [28+ebx],ecx
935 jnz NEAR L
$018aw_loop
937 mov ebp,DWORD [32+esp]
1037 cmp DWORD [36+esp],0
1039 mov ebp,DWORD [36+esp]
1042 jge NEAR L
$021pw_pos
1048 jz NEAR L
$022pw_neg_finish
1061 mov edx,DWORD [4+edi]
1067 mov DWORD [4+ebx],ecx
1070 mov edx,DWORD [8+edi]
1076 mov DWORD [8+ebx],ecx
1079 mov edx,DWORD [12+edi]
1085 mov DWORD [12+ebx],ecx
1088 mov edx,DWORD [16+edi]
1094 mov DWORD [16+ebx],ecx
1097 mov edx,DWORD [20+edi]
1103 mov DWORD [20+ebx],ecx
1106 mov edx,DWORD [24+edi]
1112 mov DWORD [24+ebx],ecx
1115 mov edx,DWORD [28+edi]
1121 mov DWORD [28+ebx],ecx
1126 jnz NEAR L
$023pw_neg_loop
1128 mov edx,DWORD [36+esp]
1146 mov edx,DWORD [4+edi]
1153 mov DWORD [4+ebx],ecx
1157 mov edx,DWORD [8+edi]
1164 mov DWORD [8+ebx],ecx
1168 mov edx,DWORD [12+edi]
1175 mov DWORD [12+ebx],ecx
1179 mov edx,DWORD [16+edi]
1186 mov DWORD [16+ebx],ecx
1190 mov edx,DWORD [20+edi]
1197 mov DWORD [20+ebx],ecx
1201 mov edx,DWORD [24+edi]
1207 mov DWORD [24+ebx],ecx
1208 jmp NEAR L
$020pw_end
1211 jz NEAR L
$024pw_pos_finish
1217 jnc NEAR L
$026pw_nc0
1219 mov ecx,DWORD [4+esi]
1221 mov DWORD [4+ebx],ecx
1222 jnc NEAR L
$027pw_nc1
1224 mov ecx,DWORD [8+esi]
1226 mov DWORD [8+ebx],ecx
1227 jnc NEAR L
$028pw_nc2
1229 mov ecx,DWORD [12+esi]
1231 mov DWORD [12+ebx],ecx
1232 jnc NEAR L
$029pw_nc3
1234 mov ecx,DWORD [16+esi]
1236 mov DWORD [16+ebx],ecx
1237 jnc NEAR L
$030pw_nc4
1239 mov ecx,DWORD [20+esi]
1241 mov DWORD [20+ebx],ecx
1242 jnc NEAR L
$031pw_nc5
1244 mov ecx,DWORD [24+esi]
1246 mov DWORD [24+ebx],ecx
1247 jnc NEAR L
$032pw_nc6
1249 mov ecx,DWORD [28+esi]
1251 mov DWORD [28+ebx],ecx
1252 jnc NEAR L
$033pw_nc7
1257 jnz NEAR L
$025pw_pos_loop
1259 mov ebp,DWORD [36+esp]
1266 jnc NEAR L
$034pw_tail_nc0
1270 mov ecx,DWORD [4+esi]
1272 mov DWORD [4+ebx],ecx
1273 jnc NEAR L
$035pw_tail_nc1
1277 mov ecx,DWORD [8+esi]
1279 mov DWORD [8+ebx],ecx
1280 jnc NEAR L
$036pw_tail_nc2
1284 mov ecx,DWORD [12+esi]
1286 mov DWORD [12+ebx],ecx
1287 jnc NEAR L
$037pw_tail_nc3
1291 mov ecx,DWORD [16+esi]
1293 mov DWORD [16+ebx],ecx
1294 jnc NEAR L
$038pw_tail_nc4
1298 mov ecx,DWORD [20+esi]
1300 mov DWORD [20+ebx],ecx
1301 jnc NEAR L
$039pw_tail_nc5
1305 mov ecx,DWORD [24+esi]
1307 mov DWORD [24+ebx],ecx
1308 jnc NEAR L
$040pw_tail_nc6
1310 jmp NEAR L
$020pw_end
1315 mov ecx,DWORD [4+esi]
1316 mov DWORD [4+ebx],ecx
1318 mov ecx,DWORD [8+esi]
1319 mov DWORD [8+ebx],ecx
1321 mov ecx,DWORD [12+esi]
1322 mov DWORD [12+ebx],ecx
1324 mov ecx,DWORD [16+esi]
1325 mov DWORD [16+ebx],ecx
1327 mov ecx,DWORD [20+esi]
1328 mov DWORD [20+ebx],ecx
1330 mov ecx,DWORD [24+esi]
1331 mov DWORD [24+ebx],ecx
1333 mov ecx,DWORD [28+esi]
1334 mov DWORD [28+ebx],ecx
1340 jnz NEAR L
$041pw_nc_loop
1341 mov ebp,DWORD [36+esp]
1343 jz NEAR L
$042pw_nc_end
1348 jz NEAR L
$042pw_nc_end
1349 mov ecx,DWORD [4+esi]
1350 mov DWORD [4+ebx],ecx
1353 jz NEAR L
$042pw_nc_end
1354 mov ecx,DWORD [8+esi]
1355 mov DWORD [8+ebx],ecx
1358 jz NEAR L
$042pw_nc_end
1359 mov ecx,DWORD [12+esi]
1360 mov DWORD [12+ebx],ecx
1363 jz NEAR L
$042pw_nc_end
1364 mov ecx,DWORD [16+esi]
1365 mov DWORD [16+ebx],ecx
1368 jz NEAR L
$042pw_nc_end
1369 mov ecx,DWORD [20+esi]
1370 mov DWORD [20+ebx],ecx
1373 jz NEAR L
$042pw_nc_end
1374 mov ecx,DWORD [24+esi]
1375 mov DWORD [24+ebx],ecx