Instructions
MCF548x Reference Manual, Rev. 3
Freescale Semiconductor 6-29
Some differences affect function activation and return. M68000 subroutines typically began with
FMOVEM #list,-(a7) to save registers on the system stack, with each register occupying three longwords.
In ColdFire, each register occupies two longwords and the stack pointer must be adjusted before the
FMOVEM instruction. A similar sequence generally occurs at the end of the function, preparing to return
control to the calling routine.
The examples in Table 6-27, Table 6-28, and Table 6-29 show a M68000 operation and the equivalent
ColdFire sequence.
If the subroutine includes LINK and UNLK instructions, the stack space needed for FPU register storage
can be factored into these operations and LEA instructions are not required.
The M68000 FPU supports loads and stores of multiple control registers (FPCR, FPSR, and FPIAR) with
one instruction. For ColdFire, only one can be moved at a time.
For instructions that require an unsupported addressing mode, the operand address can be formed with a
LEA instruction immediately before the FPU operation. See Table 6-28.
The M68000 FPU allows floating-point instructions to directly specify immediate values; the ColdFire
FPU does not support these types of immediate constants. It is recommended that floating-point immediate
Support for fpGEN xxx.{w,l},FPx Yes No
Support for fpGEN d8(PC,Xi),FPx Yes No
Support for fpGEN #xxx,FPx Yes No
Support for fmovem (Ay)+,#list Yes No
Support for fmovem #list,-(Ax) Yes No
Support for fmovem FP Control Registers Yes No
Table 6-27. M68000/ColdFire Operation Sequence 11
1 n is the number of FP registers to be saved/restored.
M68000 ColdFire Equivalent
fmovem.x #list,-(a7) lea -8*n(a7),a7;allocate stack space
fmovem.d #list,(a7) ;save FPU registers
fmovem.x (a7)+,#list fmovem.d (a7),#list ;restore FPU registers
lea 8*n(a7),a7 ;deallocate stack space
Table 6-28. M68000/ColdFire Operation Sequence 2
M68000 ColdFire Equivalent
fadd.s label,fp2 lea label,a0;form pointer to data
fadd.s (a0),fp2
fmul.d (d8,a1,d7),fp5 lea (d8,a1,d7),a0;form pointer to data
fmul.d (a0),fp5
fcmp.l (d8,pc,d2),fp3 lea (d8,pc,d2),a0;form pointer to data
fcmp.l (a0),fp3
Table 6-26. Key Programming Model Differences (Continued)
Feature M68000 ColdFire