Wednesday, March 2, 2016

8051 MUL Instruction

Multiply

InstructionMUL AB
FunctionMultiply
Bytes1
Cycles4
Encoding1 0 1 0 0 1 0 0
OperationBA = A * B
DescriptionMUL 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 AffectedC AC F0 RS1 RS0 OV P
ExampleOriginally 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