User manual

Table Of Contents
SYSTEM CALLS
M68CPU32BUG/D REV 1 5-8
.DELAY Timer Delay Function .DELAY
5.2.4 Timer Delay Function
SYSCALL .DELAY
TRAP CODE: $0043
The .DELAY function generates timing delays based on the processor clock. This function uses
the MCU periodic interrupt timer for operation. The user specifies the desired delay count
(number of interrupt pulses generated). .DELAY returns system control to the user after the
specified delay is completed. Initialize (.TM_INI) and start (.TM_STR0) the timer before using
the .TM_RD function.
Entry Conditions:
SP ==> Delay time (number of interrupt pulses) <long>
Exit Conditions Different From Entry:
SP ==> The timer keeps running after the delay and parameters are
removed from the stack.
EXAMPLE
SYSCALL .TM INI
Initialize timer
SYSCALL .TM_STR0
Start timer
PEA.L &1500
Load a 1500 interrupt pulse delay
SYSCALL .DELAY
*
*
*
PEA.L &50000 Load a 50000 interrupt pulse delay
SYSCALL .DELAY
SYSTEM CALLS
M68CPU32BUG/D REV 1 5-9
.DIVU32 Unsigned 32 x 32 Bit Divide .DIVU32
5.2.5 Unsigned 32 x 32 Bit Divide
SYSCALL .DIVU32
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 ==> 32-bit divisor (value to divide by)
32-bit dividend (value to divide)
32-bit space for result
Exit Conditions:
SP ==> 32-bit quotient (result from division)
EXAMPLE
Divide D0 by D1, load result into D2.
SUBQ.L #4,A7
Allocate space for result
MOVE.L D0,-(A7)
Push dividend
MOVE.L D1,-(A7)
Push divisor
SYSCALL .DIVU32
Divide D0 by D1
MOVE.L (A7)+,D2
Get quotient
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...