HD6475328-CP10 HITACHI [Hitachi Semiconductor], HD6475328-CP10 Datasheet - Page 98

no-image

HD6475328-CP10

Manufacturer Part Number
HD6475328-CP10
Description
original Hitachi CMOS microcomputer unit (MCU)
Manufacturer
HITACHI [Hitachi Semiconductor]
Datasheet
3.9.2 Note on MULXU Instruction
Note that in the case described below, the H8/532 multiply instruction does not give correct
results.
(1)
(2)
(3)
Programmers using the C compiler should bear the following programming note in mind.
• Conditions under which the compiler generates a MULXU.B Rn, Rn instruction
The C compiler generates a MULXU.B Rn, Rn instruction when the following two conditions
are satisfied in the source program:
Problem
The result of a squaring operation such as MULXU.B Rn, Rn is indeterminate. This problem
occurs when the same register is specified for the source and destination of a byte
multiplication operation.
This problem occurs only in ZTAT versions of the H8/532. It does not occur in versions
with masked ROM.
Solution
The problem can be avoided by the following methods.
This problem occurs only in the H8/532. It does not occur in other chips in the H8/500
Series (such as the H8/520).
Note on usage of C compiler
Place the source and destination operands in different registers.
Example: MULXU.B R4, R4
Use a word multiplication instruction.
Example: MULXU.B R4, R4
Place one of the operands in memory.
Example: MULXU.B R4, R4
79
MOV.W R4, R5
MULXU.B R5, R4
MULXU.W R4, R4
MOV.W R5, R4
MOV.W R4, @–SP
MULXU.B @(1,SP), R4
ADDS #2, SP

Related parts for HD6475328-CP10