Multiply
Instruction | MUL AB |
---|---|
Function | Multiply |
Bytes | 1 |
Cycles | 4 |
Encoding | 1 0 1 0 0 1 0 0 |
Operation | BA = A * B |
Description | MUL AB multiplies the unsigned 8-bit integers in the Accumulator and register B. The low-order byte of the 16-bit product is left in the Accumulator, and the high-order byte in B. If the product is greater than 255 (0FFH), the overflow flag is set; otherwise it is cleared. The carry flag is always cleared. |
Flags Affected | C AC F0 RS1 RS0 OV P |
Example | Originally the Accumulator holds the value 80 (50H). Register B holds the value 160 (0A0H). The instruction, MUL AB will give the product 12,800 (3200H), so B is changed to 32H (00110010B) and the Accumulator is cleared. The overflow flag is set, carry is cleared. |
Related topics:
8051 Arithmetic Operation Instructions | 8051 ADD Instruction | 8051 ADDC Instruction | 8051 SUBB Instruction | 8051 INC Instruction | 8051 DEC Instruction | 8051 DIV Instruction | 8051 DA Instruction
List of topics: 8051
No comments:
Post a Comment