MC68060 Software Package
MOTOROLA
M68060 USER’S MANUAL
C-11
divide and the source operand is a zero, then the library routine (as it is last instruction) exe-
cutes an implemented divide using a zero source operand so that an integer divide-by-zero
exception will be taken. Although the exception stack frame will not point to the correct
instruction, the user can at least be able to record that such an event occurred.
C.3 FLOATING-POINT EMULATION PACKAGE (MC68060FPSP)
The MC68060 does not implement some floating-point instructions, addressing modes, and
data types on-chip in order to streamline internal operations. This results in an overall sys-
tem performance improvement at the expense of software emulation of these unimple-
mented instructions, addressing modes, and data types. The M68060SP provides three
separate modules that are related to floating-point operations. The first floating-point module
is the full floating-point kernel module. This module is used for applications that require emu-
lation of the full MC68881 floating-point instruction set, data-types, and IEEE-754 exception
handling. The second floating-point module is the floating-point library. This library is pro-
vided as a separate module for applications that need to avoid the latency incurred by the
F-line exception processing for unimplemented floating-point instructions. However, this
method requires recompiling of existing software to implement subroutine calls. The third
floating-point module, the partial floating-point kernel module, is optional and is used prima-
rily in systems that also integrate the floating-point library. The partial floating-point kernel
module is similar in function to the full floating-point kernel except that it does not contain
the unimplemented floating-point instruction exception handler. This module is provided for
the purpose of saving memory space. Otherwise, the full floating-point kernel module must
be used instead.
* mulu.l <ea>,Dh:Dl
* mulu.l _multiplier,d1:d0
subq.l #$8,sp ; make room for result on stack
pea (sp) ; pass: result addr on stack
move.l d0,-(sp) ; pass: multiplicand on stack
move.l _multiplier,-(sp) ; pass: multiplier on stack
bsr.l _060LISP_TOP+$18 ; branch to multiply routine
add.l #$c,sp ; clear arguments from stack
move.l (sp)+,d1 ; load result[63:32]
move.l (sp)+,d0 ; load result[31:0]
Figure C-6. MUL Instruction Call Example
* cmp2.l <ea>,Rn
* cmp2.l _bounds,d0
pea _bounds ; pass ptr to bounds
move.l d0,-(sp) ; pass Rn
bsr.l _060LSP_TOP_+$48 ; branch to “cmp2” routine
add.l #$8,sp ; clear arguments from stack
Figure C-7. CMP2 Instruction Call Example