Motorola M68000 User Manual Page 100

  • Download
  • Add to my manuals
  • Print
  • Page
    / 357
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 99
Floating Point Instructions
MOTOROLA M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL 5-89
FMOVEM Move Multiple Floating-Point FMOVEM
Data Registers
(MC6888X, MC68040)
In this example, a convention is defined by which each called procedure is passed a
word mask in D7 that identifies all floating-point registers in use by the calling proce-
dure. Bits 15 – 8 identify the registers in the order FP0 – FP7, and bits 7 – 0 identify the
registers in the order FP7 – FP0 (the two masks are required due to the different trans-
fer order used by the predecrement and postincrement addressing modes). The code
used by the calling procedure consists of simply moving the mask (which is generated
at compile time) for the floating-point data registers currently in use into D7:
Calling procedure...
The entry code for all other procedures computes two masks. The first mask identifies
the registers in use by the calling procedure that are used by the called procedure (and
therefore saved and restored by the called procedure). The second mask identifies the
registers in use by the calling procedure that are used by the called procedure (and
therefore not saved on entry). The appropriate registers are then stored along with the
two masks:
Called procedure...
If the second procedure calls a third procedure, a register mask is passed to the third
procedure that indicates which registers must not be altered by the third procedure.
This mask identifies any registers in the list from the first procedure that were not saved
by the second procedure, plus any registers used by the second procedure that must
not be altered by the third procedure.
MOVE.W #ACTIVE,D7 Load the list of FP registers that are
in use.
BSR PROC_2
MOVE.W D7,D6 Copy the list of active registers.
AND.W #WILL_USE,D7 Generate the list of doubly-used
registers.
FMOVEM D7, – (A7) Save those registers.
MOVE.W D7, – (A7) Save the register list.
EOR.W D7,D6 Generate the list of not saved active
registers.
MOVE.W D6, – (A7) Save it for later use.
Page view 99
1 2 ... 95 96 97 98 99 100 101 102 103 104 105 ... 356 357

Comments to this Manuals

No comments