<< Previous | Next >>

MUL     Multiply     Rabbit 2000/3000/4000/5000 Instruction

Opcode
Instruction
Operation
F7 MUL HL:BC = BC · DE

8-Bit Access
16-Bit Unaligned
16-Bit Aligned
Rabbit 2000/3000/4000
12
n/a
n/a
Rabbit 5000
12
12
12

Flags ALTD IOI/IOE
S
Z
L/V
C
F
R
SP
S
D
-
-
-
-

Description

A signed multiplication operation is performed on the 16-bit binary integers in the BC and DE registers. The signed 32-bit result is loaded in HL (bits 31 through 16) and BC (bits 15 through 0) registers.

Examples:


LD BC, 0FFFFh    ;BC gets -1
LD DE, 0FFFFh    ;DE gets -1
MUL              ;HL|BC = 1, HL gets 0000h, BC gets 0001h

In the above example, the 2's complement of FFFFh is 0001h.


LD BC, 0FFFFh    ;BC gets -1
LD DE, 00001h    ;DE gets 1
MUL              ;HL|BC = -1, HL gets FFFFh, BC gets FFFFh

Rabbit Instructions << Previous | Next >> rabbit.com