Chapter 2
CPU
Extended Calculation Function II - 17
2.3 Extended Calculation Function
2.3.1 Overview
The LSI contains the following calculator functions.
Table:2.3.1 List of Extended Calculation Functions
Calculation Instruction Operation
Execution
cycle
PSW bit
change
VF NF CF ZF
16-bit × 16-bit
multiplication
(unsigned)
MOV 1, (0x3F07)
Extended calculation
macro instruction
MULWU
DW0 * DW1 → {DW1, DW0} 4 0 z 0 z
16-bit × 16-bit
multiplication (signed)
MOV 2, (0x3F07)
Extended calculation
macro instruction
MULW
DW0 * DW1 → {DW1, DW0} 4 0 z 0 z
32-bit / 16-bit
division (unsigned)
MOV 4, (0x3F07)
Extended calculation
macro instruction
DIVWU
{DW1, DW0} / A0
→ DW0 ⋅⋅⋅ DW1
21 zz0 z
BCD addition
(without carry)
MOV 16, (0x3F07)
Extended calculation
macro instruction
BCDADD
D0 (BCD) + D1 (BCD)
→ D0 (BCD)
400zz
BCD addition
(with carry)
MOV 32, (0x3F07)
Extended calculation
macro instruction
BCDADDC
D0 (BCD) + D1 (BCD) +
PSW.CF
→ D0 (BCD)
400zz
BCD subtraction
(without carry)
MOV 64, (0x3F07)
Extended calculation
macro instruction
BCDSUB
D0 (BCD) - D1 (BCD)
→ D0 (BCD)
400zz
BCD subtraction
(with carry)
MOV 128, (0x3F07)
Extended calculation
macro instruction
BCDSUBC
D0 (BCD) - D1 (BCD) - PSW.CF
→ D0 (BCD)
400zz
z: bit changes.