Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What does Int mul(Int a, int b) mean by adding int before them?
What does Int mul(Int a, int b) mean by adding int before them?
MUL assembly language unsigned number multiplication instruction

Format: MUL SRC

Actions performed:

Byte operand: (AX)←(AL)*(SRC)

Word operand: (DX, AX)←(AX)*(SRC)

Double-word operand: (EDX, EAX)←(EAX)*(SRC)

Mul:80c 5 1 There is only one instruction in the multiplication instruction of the single chip microcomputer system:

MUL AB

The multiplication instruction is used to multiply two unsigned 8-bit binary numbers in A and B. The lower 8 bits of the product of 16 bits are stored in A and the upper 8 bits are stored in B. If the product is greater than 256, that is, the upper B is not 0, then OV is set to1; Otherwise, OV is cleared and CY is always cleared.

For example, let (A)=50H(80) and (B)=0A0H( 160).

If MUL AB is executed,

The implementation result is:

The product is 3200H( 12800).

(A)=00H,(B)=32H,(OV)= 1,(CY)=0

The function of the following program is to input the values of x and y for many times and find the sum of x and y.

int mul(int a,int b)

{

? int c = 0;

? c = a+b;

? Return to c;

}