User’s Manual
C166S V1 SubSystem
Central Processing Unit
User’s Manual
3-74
V 1.6, 2001-08
When a division or multiplication was interrupted before its completion and the multiply/
divide unit is required, the MDC register must first be saved along with registers MDH
and MDL (to be able to restart the interrupted operation later), and then it must be
cleared for the new calculation. After completion of the new division or multiplication, the
state of the interrupted multiply or divide operation must be restored.
The MDRIU flag is the only portion of the MDC register that might be of interest for the
user. The remaining portions of the MDC register are reserved for dedicated use by the
hardware, and should never be modified by the user other than described above.
Otherwise, correct continuation of an interrupted multiply or divide operation cannot be
guaranteed.
Multiplication or division is performed simply by specifying the correct (signed or
unsigned) version of the multiply or divide instruction. The result is then stored in register
MD. The overflow flag (V) is set if the result of a multiply or divide instruction is greater
than 16 bits. This flag can be used to determine whether both word halves must be
transferred from register MD. The high portion of MD (MDH) must be moved into the
register file or memory first, in order to ensure that the MDRIU flag reflects the correct
state.
The following instruction sequence performs an unsigned 16-by-16-bit multiplication:
SAVE:
JNB
MDRIU, START
;Test if MD was in use.
SCXT
MDC, #0010H
;Save and clear control register,
;leaving MDRIU set
;(only required for interrupted
;multiply/divide instructions)
BSET
SAVED
;Indicate the save operation
PUSH
MDH
;Save previous MD contents...
PUSH
MDL
;...on system stack
START:
MULU
R1, R2
;Multiply 16·16 unsigned, Sets MDRIU
Field
Bits
Type Description
MDRIU
[4]
rwh
Multiply/Divide Register In Use
0:
Cleared when register MDL is read via
software.
1:
Set when register MDL or MDH is written
via software, or when a multiply or divide
instruction is executed.
!!
[7],[6],
[5],[3],
[2],[1],
[0]
rwh
Internal Machine Status
The multiply/divide unit uses these bits to control
internal operations. Never modify these bits
without saving and restoring register MDC
Содержание C166S V1 SubSystem
Страница 10: ...User s Manual C166S V1 SubSystem User s Manual I 6 V 1 6 2001 08...
Страница 16: ...User s Manual C166S V1 SubSystem Introduction User s Manual 1 6 V 1 6 2001 08...
Страница 126: ...User s Manual C166S V1 SubSystem Central Processing Unit User s Manual 3 96 V 1 6 2001 08...
Страница 178: ...User s Manual C166S V1 SubSystem Memory Organization User s Manual 4 52 V 1 6 2001 08...
Страница 206: ...User s Manual C166S V1 SubSystem Instruction Set User s Manual 5 28 V 1 6 2001 08...
Страница 306: ...User s Manual C166S V1 SubSystem Detailed Instruction Set User s Manual 6 100 V 1 6 2001 08...
Страница 362: ...User s Manual C166S V1 SubSystem The External Bus Interface User s Manual 8 40 V 1 6 2001 08...
Страница 452: ...User s Manual C166S V1 SubSystem General Purpose Timer Unit User s Manual 12 44 V 1 6 2001 08...
Страница 454: ...User s Manual C166S V1 SubSystem Instruction Index User s Manual 13 2 V 1 6 2001 08...
Страница 459: ......