Changeset 8325447 in buchla-68k for lib700/uldiv.s
- Timestamp:
- 08/07/2017 02:04:35 PM (7 years ago)
- Branches:
- master
- Children:
- 27c8d40
- Parents:
- 84c0125
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib700/uldiv.s
r84c0125 r8325447 3 3 | Version 2 -- 1987-06-08 -- D.N. Lynx Crowe 4 4 | Lifted from the Alcyon C library by disassembly so I could fix a bug - 5 | _uldivr must be in the bss segment so the code will work in PROM.5 | uldivr must be in the bss segment so the code will work in PROM. 6 6 7 7 | long … … 19 19 .text 20 20 21 .xdef _uldiv,_uldivr21 .xdef uldiv,uldivr 22 22 23 23 DIVIDEND = 8 24 24 DIVISOR = 12 25 25 26 _uldiv: link a6,#0 | Link stack frames26 uldiv: link a6,#0 | Link stack frames 27 27 movem.l d3-d7,-(a7) | Save registers 28 28 move.l DIVIDEND(a6),d7 | d7 = DIVIDEND … … 31 31 bne notdzero | Jump if not 32 32 33 move.l #0x80000000, _uldivr | Force error result33 move.l #0x80000000,uldivr | Force error result 34 34 move.l #0x80000000,d0 | ... by dividing 35 35 divu #0,d0 | ... by zero … … 39 39 bls notunflo | Jump if not 40 40 41 move.l d7, _uldivr | Remainder = dividend41 move.l d7,uldivr | Remainder = dividend 42 42 clr.l d0 | Quotient = 0 43 43 bra ulexit | Exit … … 81 81 bra divloop3 | Loop for next bit 82 82 83 setreslt: move.l d7, _uldivr | Store remainder83 setreslt: move.l d7,uldivr | Store remainder 84 84 move.l d5,d0 | Put quotient in d0 85 85 … … 92 92 .even 93 93 94 _uldivr:.ds.l 194 uldivr: .ds.l 1 95 95 96 96 .end
Note:
See TracChangeset
for help on using the changeset viewer.