remainder now returned in d0
This commit is contained in:
parent
ea63596eb3
commit
9c8b34c47d
1 changed files with 5 additions and 5 deletions
|
@ -7,13 +7,13 @@
|
||||||
! signed long divide
|
! signed long divide
|
||||||
.sect .text
|
.sect .text
|
||||||
.dvi:
|
.dvi:
|
||||||
move.l 4(sp),d0
|
move.l 4(sp),d2
|
||||||
move.l 8(sp),d1
|
move.l 8(sp),d1
|
||||||
move.l d4,-(sp)
|
move.l d4,-(sp)
|
||||||
clr.l d4
|
clr.l d4
|
||||||
tst.l d0 ! divisor
|
tst.l d2 ! divisor
|
||||||
bpl 1f
|
bpl 1f
|
||||||
neg.l d0
|
neg.l d2
|
||||||
not d4
|
not d4
|
||||||
1:
|
1:
|
||||||
tst.l d1 ! dividend
|
tst.l d1 ! dividend
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
swap d4
|
swap d4
|
||||||
2:
|
2:
|
||||||
move.l d1,-(sp)
|
move.l d1,-(sp)
|
||||||
move.l d0,-(sp)
|
move.l d2,-(sp)
|
||||||
jsr .dvu
|
jsr .dvu
|
||||||
tst d4
|
tst d4
|
||||||
beq 5f
|
beq 5f
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
5:
|
5:
|
||||||
tst.l d4
|
tst.l d4
|
||||||
bpl 6f
|
bpl 6f
|
||||||
neg.l d2 ! remainder
|
neg.l d0 ! remainder
|
||||||
6:
|
6:
|
||||||
move.l (sp)+,d4
|
move.l (sp)+,d4
|
||||||
move.l (sp)+,a0
|
move.l (sp)+,a0
|
||||||
|
|
Loading…
Add table
Reference in a new issue