Unsigned 32 X 32 Bit Divide (.Divu32) - Motorola M68CPU32BUG User Manual

Debug monitor
Table of Contents

Advertisement

.DIVU32
5.2.5
Unsigned 32 x 32 Bit Divide
SYSCALL
TRAP CODE: $006A
Divide two 32-bit unsigned integers and return the quotient on the stack as a 32-bit unsigned
integer. The case of division by zero is handled by returning the maximum unsigned value
$FFFFFFFF.
Entry Conditions:
SP ==>
Exit Conditions:
SP ==>
EXAMPLE
Divide D0 by D1, load result into D2.
SUBQ.L
#4,A7
MOVE.L
D0,-(A7)
MOVE.L
D1,-(A7)
SYSCALL
.DIVU32
MOVE.L
(A7)+,D2
M68CPU32BUG/D REV 1
Unsigned 32 x 32 Bit Divide
.DIVU32
32-bit divisor (value to divide by)
32-bit dividend (value to divide)
32-bit space for result
32-bit quotient (result from division)
Allocate space for result
Push dividend
Push divisor
Divide D0 by D1
Get quotient
5-9
SYSTEM CALLS
.DIVU32

Advertisement

Table of Contents
loading

Table of Contents