Loading...
MC68060 Software Package
C-10
M68060 USER’S MANUAL
MOTOROLA
The condition code register upon return from all of the library routines is correct. Figure C-5
provides a C-code representation of the integer library routines in the M68060SP.
For example, to use a 64-bit divide instruction, do a “bsr” or “jsr” to the entry-point defined
by the MC68060ILSP entry table. A compiler-generated code sequence for unsigned multi-
ply could resemble Figure C-6.
The library routines also return the correct condition code register value. If this is important,
then the caller of the library routine must make sure that the value is not lost while popping
other items off of the stack. An example of using the CMP2 instruction is given in Figure C-7.
The unimplemented integer instruction library module contains no operating system depen-
dencies and does not require a call-out dispatch table. If the instruction being emulated is a
/* 64-bit (32x32 -> 64) unsigned multiply routine */
void _mulu64(multiplier,multiplicand,result)
unsigned int multiplier;
unsigned int multiplicand;
unsigned int *result; /* array for result */
/* 64-bit (32x32 -> 64) signed multiply routine */
void _muls64(multiplier,multiplicand,result)
int multiplier;
int multiplicand;
int *result; /* array for result */
/* 64-bit (32/32 -> 32r:32q) unsigned divide routine */
void _divu64(divisor,dividend_hi,dividend_lo,result)
unsigned int divisor;
unsigned int dividend_hi, dividend_lo;
unsigned int *result; /* array for result */
/* 64-bit (32/32 -> 32r:32q) signed divide routine */
void _divs64(divisor,dividend_hi,dividend_lo,result)
int divisor;
int dividend_hi,dividend_lo;
int *result; /* array for result */
/* CMP2 using an “A”ddress or “D”ata register. size = byte. */
void _cmp2_{D,A}b(rn,bounds)
int rn;
char *bounds; /* pointer to byte bounds array */
/* CMP2 using an “A”ddress or “D”ata register. size = word. */
void _cmp2_{D,A}w(rn,bounds)
int rn;
short *bounds; /* pointer to word bounds array */
/* CMP2 using an “A”ddress or “D”ata register. size = longword. */
void _cmp2_{D,A}l(rn,bounds)
int rn;
int *bounds; /* pointer to longword bounds array */
Figure C-5. C-Code Representation of Integer Library Routines
Loading...
Terms of Use | Privacy Policy | DMCA Policy
2006-2020 Rsmanuals.com