BSD 3 development
[unix-history] / usr / src / cmd / lisp / dsneg.s
CommitLineData
8cd657f4
JF
1 .globl _dsneg
2#
3# dsneg(top, bot);
4# int *top, *bot;
5#
6# routine to destructively negate a bignum stored in array format
7# lower order stuff at higher addresses. It is assume that the
8# result will be positive.
9#
10_dsneg: .word 0
11 movl 4(ap),r1 #load up address.
12 clrl r2 #set carry
13loop: mnegl (r1),r0 #negate and take carry into account.
14 addl2 r2,r0
15 extzv $0,$30,r0,(r1)
16 extv $30,$2,r0,r2
17 acbl 8(ap),$-4,r1,loop
18 #decrease r1, and branch back if appropriate.
19 ret