home *** CD-ROM | disk | FTP | other *** search
- .text | cjpurcell 30Jul89
- .even |
- .globl __umulsi3 |
- .globl ___umulsi3 |
- __umulsi3: |
- ___umulsi3: |
- link a6,#0 | 0 bytes of local
- movel d2,sp@- | push d2
- movel a6@(8),d2 | get a
- beq umul_zero | 0? return 0
- movel a6@(12),d1 | get b
- beq umul_zero | 0? return 0
- |
- mulu d1,d2 | mul bottom parts
- movel d2,d0 | save that
- movew a6@(8),d2 | get hi part of a
- beq umul_1 | zero, skip it
- movel a6@(12),d1 | get b
- mulu d1,d2 | mul a hi by b lo
- lsll #8,d2 | shift over
- lsll #8,d2 | ...twice...
- addl d2,d0 | add that in
- umul_1: |
- clrl d1 |
- movew a6@(12),d1 | get b hi
- beq umul_ret |
- movel a6@(8),d2 | and a lo
- mulu d1,d2 | mult those
- lsll #8,d2 | shift it over
- lsll #8,d2 | ... twice...
- addl d2,d0 | and add that in
- bra umul_ret | go home
- umul_zero: |
- clrl d0 | return 0
- umul_ret: |
- movel sp@+,d2 | get d2 back
- |
- unlk a6 | flush frame
- rts |
-