~ubuntu-branches/ubuntu/karmic/nss/karmic-updates

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/freebl/mpi/mpi_x86_os2.s

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-03-31 02:23:43 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100331022343-ck07ylqk8q474x26
Tags: 3.12.6-0ubuntu0.9.10.1
* New upstream release 3.12.6 RTM (NSS_3_12_6_RTM)
  - fixes CVE-2009-3555 aka US-CERT VU#120541
* Adjust patches to changed upstream code base
  - update debian/patches/38_kbsd.patch
  - update debian/patches/38_mips64_build.patch
  - update debian/patches/85_security_load.patch
* Remove patches that are merged upstream
  - delete debian/patches/91_nonexec_stack.patch
  - update debian/patches/series
* Bump nspr dependency to 4.8
  - update debian/control
* Add new symbols for 3.12.6
  - update debian/libnss3-1d.symbols 
* Enable transitional scheme for SSL renegotiation
  - add 97_SSL_RENEGOTIATE_TRANSITIONAL.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# ***** BEGIN LICENSE BLOCK *****
 
3
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
4
#
 
5
# The contents of this file are subject to the Mozilla Public License Version
 
6
# 1.1 (the "License"); you may not use this file except in compliance with
 
7
# the License. You may obtain a copy of the License at
 
8
# http://www.mozilla.org/MPL/
 
9
#
 
10
# Software distributed under the License is distributed on an "AS IS" basis,
 
11
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
12
# for the specific language governing rights and limitations under the
 
13
# License.
 
14
#
 
15
# The Original Code is the Netscape security libraries.
 
16
#
 
17
# The Initial Developer of the Original Code is
 
18
# Netscape Communications Corporation.
 
19
# Portions created by the Initial Developer are Copyright (C) 2000
 
20
# the Initial Developer. All Rights Reserved.
 
21
#
 
22
# Contributor(s):
 
23
#
 
24
# Alternatively, the contents of this file may be used under the terms of
 
25
# either the GNU General Public License Version 2 or later (the "GPL"), or
 
26
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
27
# in which case the provisions of the GPL or the LGPL are applicable instead
 
28
# of those above. If you wish to allow use of your version of this file only
 
29
# under the terms of either the GPL or the LGPL, and not to allow others to
 
30
# use your version of this file under the terms of the MPL, indicate your
 
31
# decision by deleting the provisions above and replace them with the notice
 
32
# and other provisions required by the GPL or the LGPL. If you do not delete
 
33
# the provisions above, a recipient may use your version of this file under
 
34
# the terms of any one of the MPL, the GPL or the LGPL.
 
35
#
 
36
# ***** END LICENSE BLOCK *****
 
37
 
 
38
#  $Id: mpi_x86_os2.s,v 1.1 2009/06/04 23:53:42 julien.pierre.boogz%sun.com Exp $
 
39
#
 
40
 
 
41
.data
 
42
.align 4
 
43
 #
 
44
 # -1 means to call _s_mpi_is_sse to determine if we support sse 
 
45
 #    instructions.
 
46
 #  0 means to use x86 instructions
 
47
 #  1 means to use sse2 instructions
 
48
.type   is_sse,@object
 
49
.size   is_sse,4
 
50
is_sse: .long   -1 
 
51
 
 
52
#
 
53
# sigh, handle the difference between -fPIC and not PIC
 
54
# default to pic, since this file seems to be exclusively
 
55
# linux right now (solaris uses mpi_i86pc.s and windows uses
 
56
# mpi_x86_asm.c)
 
57
#
 
58
#.ifndef NO_PIC
 
59
#.macro GET   var,reg
 
60
#    movl   \var@GOTOFF(%ebx),\reg
 
61
#.endm
 
62
#.macro PUT   reg,var
 
63
#    movl   \reg,\var@GOTOFF(%ebx)
 
64
#.endm
 
65
#.else
 
66
.macro GET   var,reg
 
67
    movl   \var,\reg
 
68
.endm
 
69
.macro PUT   reg,var
 
70
    movl   \reg,\var
 
71
.endm
 
72
#.endif
 
73
 
 
74
.text
 
75
 
 
76
 
 
77
 #  ebp - 36:   caller's esi
 
78
 #  ebp - 32:   caller's edi
 
79
 #  ebp - 28:   
 
80
 #  ebp - 24:   
 
81
 #  ebp - 20:   
 
82
 #  ebp - 16:   
 
83
 #  ebp - 12:   
 
84
 #  ebp - 8:    
 
85
 #  ebp - 4:    
 
86
 #  ebp + 0:    caller's ebp
 
87
 #  ebp + 4:    return address
 
88
 #  ebp + 8:    a       argument
 
89
 #  ebp + 12:   a_len   argument
 
90
 #  ebp + 16:   b       argument
 
91
 #  ebp + 20:   c       argument
 
92
 #  registers:
 
93
 #      eax:
 
94
 #      ebx:    carry
 
95
 #      ecx:    a_len
 
96
 #      edx:
 
97
 #      esi:    a ptr
 
98
 #      edi:    c ptr
 
99
.globl  _s_mpv_mul_d
 
100
.type   _s_mpv_mul_d,@function
 
101
_s_mpv_mul_d:
 
102
    GET    is_sse,%eax
 
103
    cmp    $0,%eax
 
104
    je     _s_mpv_mul_d_x86
 
105
    jg     _s_mpv_mul_d_sse2
 
106
    call   _s_mpi_is_sse2
 
107
    PUT    %eax,is_sse
 
108
    cmp    $0,%eax
 
109
    jg     _s_mpv_mul_d_sse2
 
110
_s_mpv_mul_d_x86:
 
111
    push   %ebp
 
112
    mov    %esp,%ebp
 
113
    sub    $28,%esp
 
114
    push   %edi
 
115
    push   %esi
 
116
    push   %ebx
 
117
    movl   $0,%ebx              # carry = 0
 
118
    mov    12(%ebp),%ecx        # ecx = a_len
 
119
    mov    20(%ebp),%edi
 
120
    cmp    $0,%ecx
 
121
    je     2f                   # jmp if a_len == 0
 
122
    mov    8(%ebp),%esi         # esi = a
 
123
    cld
 
124
1:
 
125
    lodsl                       # eax = [ds:esi]; esi += 4
 
126
    mov    16(%ebp),%edx        # edx = b
 
127
    mull   %edx                 # edx:eax = Phi:Plo = a_i * b
 
128
 
 
129
    add    %ebx,%eax            # add carry (%ebx) to edx:eax
 
130
    adc    $0,%edx
 
131
    mov    %edx,%ebx            # high half of product becomes next carry
 
132
 
 
133
    stosl                       # [es:edi] = ax; edi += 4;
 
134
    dec    %ecx                 # --a_len
 
135
    jnz    1b                   # jmp if a_len != 0
 
136
2:
 
137
    mov    %ebx,0(%edi)         # *c = carry
 
138
    pop    %ebx
 
139
    pop    %esi
 
140
    pop    %edi
 
141
    leave  
 
142
    ret    
 
143
    nop
 
144
_s_mpv_mul_d_sse2:
 
145
    push   %ebp
 
146
    mov    %esp,%ebp
 
147
    push   %edi
 
148
    push   %esi
 
149
    psubq  %mm2,%mm2            # carry = 0
 
150
    mov    12(%ebp),%ecx        # ecx = a_len
 
151
    movd   16(%ebp),%mm1        # mm1 = b
 
152
    mov    20(%ebp),%edi
 
153
    cmp    $0,%ecx
 
154
    je     6f                   # jmp if a_len == 0
 
155
    mov    8(%ebp),%esi         # esi = a
 
156
    cld
 
157
5:
 
158
    movd   0(%esi),%mm0         # mm0 = *a++
 
159
    add    $4,%esi
 
160
    pmuludq %mm1,%mm0           # mm0 = b * *a++
 
161
    paddq  %mm0,%mm2            # add the carry
 
162
    movd   %mm2,0(%edi)         # store the 32bit result
 
163
    add    $4,%edi
 
164
    psrlq  $32, %mm2            # save the carry
 
165
    dec    %ecx                 # --a_len
 
166
    jnz    5b                   # jmp if a_len != 0
 
167
6:
 
168
    movd   %mm2,0(%edi)         # *c = carry
 
169
    emms
 
170
    pop    %esi
 
171
    pop    %edi
 
172
    leave  
 
173
    ret    
 
174
    nop
 
175
 
 
176
 #  ebp - 36:   caller's esi
 
177
 #  ebp - 32:   caller's edi
 
178
 #  ebp - 28:   
 
179
 #  ebp - 24:   
 
180
 #  ebp - 20:   
 
181
 #  ebp - 16:   
 
182
 #  ebp - 12:   
 
183
 #  ebp - 8:    
 
184
 #  ebp - 4:    
 
185
 #  ebp + 0:    caller's ebp
 
186
 #  ebp + 4:    return address
 
187
 #  ebp + 8:    a       argument
 
188
 #  ebp + 12:   a_len   argument
 
189
 #  ebp + 16:   b       argument
 
190
 #  ebp + 20:   c       argument
 
191
 #  registers:
 
192
 #      eax:
 
193
 #      ebx:    carry
 
194
 #      ecx:    a_len
 
195
 #      edx:
 
196
 #      esi:    a ptr
 
197
 #      edi:    c ptr
 
198
.globl  _s_mpv_mul_d_add
 
199
.type   _s_mpv_mul_d_add,@function
 
200
_s_mpv_mul_d_add:
 
201
    GET    is_sse,%eax
 
202
    cmp    $0,%eax
 
203
    je     _s_mpv_mul_d_add_x86
 
204
    jg     _s_mpv_mul_d_add_sse2
 
205
    call   _s_mpi_is_sse2
 
206
    PUT    %eax,is_sse
 
207
    cmp    $0,%eax
 
208
    jg     _s_mpv_mul_d_add_sse2
 
209
_s_mpv_mul_d_add_x86:
 
210
    push   %ebp
 
211
    mov    %esp,%ebp
 
212
    sub    $28,%esp
 
213
    push   %edi
 
214
    push   %esi
 
215
    push   %ebx
 
216
    movl   $0,%ebx              # carry = 0
 
217
    mov    12(%ebp),%ecx        # ecx = a_len
 
218
    mov    20(%ebp),%edi
 
219
    cmp    $0,%ecx
 
220
    je     11f                  # jmp if a_len == 0
 
221
    mov    8(%ebp),%esi         # esi = a
 
222
    cld
 
223
10:
 
224
    lodsl                       # eax = [ds:esi]; esi += 4
 
225
    mov    16(%ebp),%edx        # edx = b
 
226
    mull   %edx                 # edx:eax = Phi:Plo = a_i * b
 
227
 
 
228
    add    %ebx,%eax            # add carry (%ebx) to edx:eax
 
229
    adc    $0,%edx
 
230
    mov    0(%edi),%ebx         # add in current word from *c
 
231
    add    %ebx,%eax            
 
232
    adc    $0,%edx
 
233
    mov    %edx,%ebx            # high half of product becomes next carry
 
234
 
 
235
    stosl                       # [es:edi] = ax; edi += 4;
 
236
    dec    %ecx                 # --a_len
 
237
    jnz    10b                  # jmp if a_len != 0
 
238
11:
 
239
    mov    %ebx,0(%edi)         # *c = carry
 
240
    pop    %ebx
 
241
    pop    %esi
 
242
    pop    %edi
 
243
    leave  
 
244
    ret    
 
245
    nop
 
246
_s_mpv_mul_d_add_sse2:
 
247
    push   %ebp
 
248
    mov    %esp,%ebp
 
249
    push   %edi
 
250
    push   %esi
 
251
    psubq  %mm2,%mm2            # carry = 0
 
252
    mov    12(%ebp),%ecx        # ecx = a_len
 
253
    movd   16(%ebp),%mm1        # mm1 = b
 
254
    mov    20(%ebp),%edi
 
255
    cmp    $0,%ecx
 
256
    je     16f                  # jmp if a_len == 0
 
257
    mov    8(%ebp),%esi         # esi = a
 
258
    cld
 
259
15:
 
260
    movd   0(%esi),%mm0         # mm0 = *a++
 
261
    add    $4,%esi
 
262
    pmuludq %mm1,%mm0           # mm0 = b * *a++
 
263
    paddq  %mm0,%mm2            # add the carry
 
264
    movd   0(%edi),%mm0
 
265
    paddq  %mm0,%mm2            # add the carry
 
266
    movd   %mm2,0(%edi)         # store the 32bit result
 
267
    add    $4,%edi
 
268
    psrlq  $32, %mm2            # save the carry
 
269
    dec    %ecx                 # --a_len
 
270
    jnz    15b                  # jmp if a_len != 0
 
271
16:
 
272
    movd   %mm2,0(%edi)         # *c = carry
 
273
    emms
 
274
    pop    %esi
 
275
    pop    %edi
 
276
    leave  
 
277
    ret    
 
278
    nop
 
279
 
 
280
 #  ebp - 8:    caller's esi
 
281
 #  ebp - 4:    caller's edi
 
282
 #  ebp + 0:    caller's ebp
 
283
 #  ebp + 4:    return address
 
284
 #  ebp + 8:    a       argument
 
285
 #  ebp + 12:   a_len   argument
 
286
 #  ebp + 16:   b       argument
 
287
 #  ebp + 20:   c       argument
 
288
 #  registers:
 
289
 #      eax:
 
290
 #      ebx:    carry
 
291
 #      ecx:    a_len
 
292
 #      edx:
 
293
 #      esi:    a ptr
 
294
 #      edi:    c ptr
 
295
.globl  _s_mpv_mul_d_add_prop
 
296
.type   _s_mpv_mul_d_add_prop,@function
 
297
_s_mpv_mul_d_add_prop:
 
298
    GET    is_sse,%eax
 
299
    cmp    $0,%eax
 
300
    je     _s_mpv_mul_d_add_prop_x86
 
301
    jg     _s_mpv_mul_d_add_prop_sse2
 
302
    call   _s_mpi_is_sse2
 
303
    PUT    %eax,is_sse
 
304
    cmp    $0,%eax
 
305
    jg     _s_mpv_mul_d_add_prop_sse2
 
306
_s_mpv_mul_d_add_prop_x86:
 
307
    push   %ebp
 
308
    mov    %esp,%ebp
 
309
    sub    $28,%esp
 
310
    push   %edi
 
311
    push   %esi
 
312
    push   %ebx
 
313
    movl   $0,%ebx              # carry = 0
 
314
    mov    12(%ebp),%ecx        # ecx = a_len
 
315
    mov    20(%ebp),%edi
 
316
    cmp    $0,%ecx
 
317
    je     21f                  # jmp if a_len == 0
 
318
    cld
 
319
    mov    8(%ebp),%esi         # esi = a
 
320
20:
 
321
    lodsl                       # eax = [ds:esi]; esi += 4
 
322
    mov    16(%ebp),%edx        # edx = b
 
323
    mull   %edx                 # edx:eax = Phi:Plo = a_i * b
 
324
 
 
325
    add    %ebx,%eax            # add carry (%ebx) to edx:eax
 
326
    adc    $0,%edx
 
327
    mov    0(%edi),%ebx         # add in current word from *c
 
328
    add    %ebx,%eax            
 
329
    adc    $0,%edx
 
330
    mov    %edx,%ebx            # high half of product becomes next carry
 
331
 
 
332
    stosl                       # [es:edi] = ax; edi += 4;
 
333
    dec    %ecx                 # --a_len
 
334
    jnz    20b                  # jmp if a_len != 0
 
335
21:
 
336
    cmp    $0,%ebx              # is carry zero?
 
337
    jz     23f
 
338
    mov    0(%edi),%eax         # add in current word from *c
 
339
    add    %ebx,%eax
 
340
    stosl                       # [es:edi] = ax; edi += 4;
 
341
    jnc    23f
 
342
22:
 
343
    mov    0(%edi),%eax         # add in current word from *c
 
344
    adc    $0,%eax
 
345
    stosl                       # [es:edi] = ax; edi += 4;
 
346
    jc     22b
 
347
23:
 
348
    pop    %ebx
 
349
    pop    %esi
 
350
    pop    %edi
 
351
    leave  
 
352
    ret    
 
353
    nop
 
354
_s_mpv_mul_d_add_prop_sse2:
 
355
    push   %ebp
 
356
    mov    %esp,%ebp
 
357
    push   %edi
 
358
    push   %esi
 
359
    push   %ebx
 
360
    psubq  %mm2,%mm2            # carry = 0
 
361
    mov    12(%ebp),%ecx        # ecx = a_len
 
362
    movd   16(%ebp),%mm1        # mm1 = b
 
363
    mov    20(%ebp),%edi
 
364
    cmp    $0,%ecx
 
365
    je     26f                  # jmp if a_len == 0
 
366
    mov    8(%ebp),%esi         # esi = a
 
367
    cld
 
368
25:
 
369
    movd   0(%esi),%mm0         # mm0 = *a++
 
370
    movd   0(%edi),%mm3         # fetch the sum
 
371
    add    $4,%esi
 
372
    pmuludq %mm1,%mm0           # mm0 = b * *a++
 
373
    paddq  %mm0,%mm2            # add the carry
 
374
    paddq  %mm3,%mm2            # add *c++
 
375
    movd   %mm2,0(%edi)         # store the 32bit result
 
376
    add    $4,%edi
 
377
    psrlq  $32, %mm2            # save the carry
 
378
    dec    %ecx                 # --a_len
 
379
    jnz    25b                  # jmp if a_len != 0
 
380
26:
 
381
    movd   %mm2,%ebx
 
382
    cmp    $0,%ebx              # is carry zero?
 
383
    jz     28f
 
384
    mov    0(%edi),%eax
 
385
    add    %ebx, %eax
 
386
    stosl
 
387
    jnc    28f
 
388
27:
 
389
    mov    0(%edi),%eax         # add in current word from *c
 
390
    adc    $0,%eax
 
391
    stosl                       # [es:edi] = ax; edi += 4;
 
392
    jc     27b
 
393
28:
 
394
    emms
 
395
    pop    %ebx
 
396
    pop    %esi
 
397
    pop    %edi
 
398
    leave  
 
399
    ret    
 
400
    nop
 
401
 
 
402
 
 
403
 #  ebp - 20:   caller's esi
 
404
 #  ebp - 16:   caller's edi
 
405
 #  ebp - 12:   
 
406
 #  ebp - 8:    carry
 
407
 #  ebp - 4:    a_len   local
 
408
 #  ebp + 0:    caller's ebp
 
409
 #  ebp + 4:    return address
 
410
 #  ebp + 8:    pa      argument
 
411
 #  ebp + 12:   a_len   argument
 
412
 #  ebp + 16:   ps      argument
 
413
 #  ebp + 20:   
 
414
 #  registers:
 
415
 #      eax:
 
416
 #      ebx:    carry
 
417
 #      ecx:    a_len
 
418
 #      edx:
 
419
 #      esi:    a ptr
 
420
 #      edi:    c ptr
 
421
 
 
422
.globl  _s_mpv_sqr_add_prop
 
423
.type   _s_mpv_sqr_add_prop,@function
 
424
_s_mpv_sqr_add_prop:
 
425
     GET   is_sse,%eax
 
426
     cmp    $0,%eax
 
427
     je     _s_mpv_sqr_add_prop_x86
 
428
     jg     _s_mpv_sqr_add_prop_sse2
 
429
     call   _s_mpi_is_sse2
 
430
     PUT    %eax,is_sse
 
431
     cmp    $0,%eax
 
432
     jg     _s_mpv_sqr_add_prop_sse2
 
433
_s_mpv_sqr_add_prop_x86:
 
434
     push   %ebp
 
435
     mov    %esp,%ebp
 
436
     sub    $12,%esp
 
437
     push   %edi
 
438
     push   %esi
 
439
     push   %ebx
 
440
     movl   $0,%ebx             # carry = 0
 
441
     mov    12(%ebp),%ecx       # a_len
 
442
     mov    16(%ebp),%edi       # edi = ps
 
443
     cmp    $0,%ecx
 
444
     je     31f                 # jump if a_len == 0
 
445
     cld
 
446
     mov    8(%ebp),%esi        # esi = pa
 
447
30:
 
448
     lodsl                      # %eax = [ds:si]; si += 4;
 
449
     mull   %eax
 
450
 
 
451
     add    %ebx,%eax           # add "carry"
 
452
     adc    $0,%edx
 
453
     mov    0(%edi),%ebx
 
454
     add    %ebx,%eax           # add low word from result
 
455
     mov    4(%edi),%ebx
 
456
     stosl                      # [es:di] = %eax; di += 4;
 
457
     adc    %ebx,%edx           # add high word from result
 
458
     movl   $0,%ebx
 
459
     mov    %edx,%eax
 
460
     adc    $0,%ebx
 
461
     stosl                      # [es:di] = %eax; di += 4;
 
462
     dec    %ecx                # --a_len
 
463
     jnz    30b                 # jmp if a_len != 0
 
464
31:
 
465
    cmp    $0,%ebx              # is carry zero?
 
466
    jz     34f
 
467
    mov    0(%edi),%eax         # add in current word from *c
 
468
    add    %ebx,%eax
 
469
    stosl                       # [es:edi] = ax; edi += 4;
 
470
    jnc    34f
 
471
32:
 
472
    mov    0(%edi),%eax         # add in current word from *c
 
473
    adc    $0,%eax
 
474
    stosl                       # [es:edi] = ax; edi += 4;
 
475
    jc     32b
 
476
34:
 
477
    pop    %ebx
 
478
    pop    %esi
 
479
    pop    %edi
 
480
    leave  
 
481
    ret    
 
482
    nop
 
483
_s_mpv_sqr_add_prop_sse2:
 
484
    push   %ebp
 
485
    mov    %esp,%ebp
 
486
    push   %edi
 
487
    push   %esi
 
488
    push   %ebx
 
489
    psubq  %mm2,%mm2            # carry = 0
 
490
    mov    12(%ebp),%ecx        # ecx = a_len
 
491
    mov    16(%ebp),%edi
 
492
    cmp    $0,%ecx
 
493
    je     36f                  # jmp if a_len == 0
 
494
    mov    8(%ebp),%esi         # esi = a
 
495
    cld
 
496
35:
 
497
    movd   0(%esi),%mm0        # mm0 = *a
 
498
    movd   0(%edi),%mm3        # fetch the sum
 
499
    add    $4,%esi
 
500
    pmuludq %mm0,%mm0          # mm0 = sqr(a)
 
501
    paddq  %mm0,%mm2           # add the carry
 
502
    paddq  %mm3,%mm2           # add the low word
 
503
    movd   4(%edi),%mm3
 
504
    movd   %mm2,0(%edi)        # store the 32bit result
 
505
    psrlq  $32, %mm2    
 
506
    paddq  %mm3,%mm2           # add the high word
 
507
    movd   %mm2,4(%edi)        # store the 32bit result
 
508
    psrlq  $32, %mm2           # save the carry.
 
509
    add    $8,%edi
 
510
    dec    %ecx                 # --a_len
 
511
    jnz    35b                  # jmp if a_len != 0
 
512
36:
 
513
    movd   %mm2,%ebx
 
514
    cmp    $0,%ebx              # is carry zero?
 
515
    jz     38f
 
516
    mov    0(%edi),%eax
 
517
    add    %ebx, %eax
 
518
    stosl
 
519
    jnc    38f
 
520
37:
 
521
    mov    0(%edi),%eax         # add in current word from *c
 
522
    adc    $0,%eax
 
523
    stosl                       # [es:edi] = ax; edi += 4;
 
524
    jc     37b
 
525
38:
 
526
    emms
 
527
    pop    %ebx
 
528
    pop    %esi
 
529
    pop    %edi
 
530
    leave  
 
531
    ret    
 
532
    nop
 
533
 
 
534
 #
 
535
 # Divide 64-bit (Nhi,Nlo) by 32-bit divisor, which must be normalized
 
536
 # so its high bit is 1.   This code is from NSPR.
 
537
 #
 
538
 # mp_err _s_mpv_div_2dx1d(mp_digit Nhi, mp_digit Nlo, mp_digit divisor,
 
539
 #                        mp_digit *qp, mp_digit *rp)
 
540
 
 
541
 #  esp +  0:   Caller's ebx
 
542
 #  esp +  4:   return address
 
543
 #  esp +  8:   Nhi     argument
 
544
 #  esp + 12:   Nlo     argument
 
545
 #  esp + 16:   divisor argument
 
546
 #  esp + 20:   qp      argument
 
547
 #  esp + 24:   rp      argument
 
548
 #  registers:
 
549
 #      eax:
 
550
 #      ebx:    carry
 
551
 #      ecx:    a_len
 
552
 #      edx:
 
553
 #      esi:    a ptr
 
554
 #      edi:    c ptr
 
555
 # 
 
556
 
 
557
.globl  _s_mpv_div_2dx1d
 
558
.type   _s_mpv_div_2dx1d,@function
 
559
_s_mpv_div_2dx1d:
 
560
       push   %ebx
 
561
       mov    8(%esp),%edx
 
562
       mov    12(%esp),%eax
 
563
       mov    16(%esp),%ebx
 
564
       div    %ebx
 
565
       mov    20(%esp),%ebx
 
566
       mov    %eax,0(%ebx)
 
567
       mov    24(%esp),%ebx
 
568
       mov    %edx,0(%ebx)
 
569
       xor    %eax,%eax         # return zero
 
570
       pop    %ebx
 
571
       ret    
 
572
       nop
 
573