Operation instruction description

zhaozj2021-02-16  55

--------- Mul ---------

MOV Al, 4CMOV BL, 11mul B

4CH, 11H is all active as a symbolic number -> 4CH = 76D-> 11h = 17D-> AX = 1292D = 050CH

------- Imul ---------

(1) --- MOV Al, 4C MOV BL, 11 Imul B

4CH, 11H is all used as a symbolic number of 4Ch = 01001100B <---- D7 bit 0, indicated as positive number 11h = 00010001B <---- D7 bit 0, expressed as positive

Imul execution step -> 4ch * 11h = 050c (two multiplication) -> AX = 050CH (positive * positive number = positive)

(2) --- MOV Al, B4 MOV BL, 11 Imul B

B4H, 11H is all used as a symbolic number of B4H = 10110100B <---- D7 bits 1, indicating the number of negative numbers 11h = 00010001B <---- D7 bit 0, indicating a positive number

IMUL execution steps -> (b4h) makeup = (10110100) to make up = 01001100 = 4CH (converted to a positive process) -> 4CH * 11H = 050CH (two numbers multiply) -> AX = (050ch) = FAF4H = -1292 (positive * negative number = negative number, you must make a supplement; ask for a result of FAF4H)

Small knot ---- In the Imul operation, the negative number will be converted into positive numbers through the need to make up. If there is one of the two numbers, it will be two positive

The product is supplemented. If the two numbers are negative, the product of the positive number is the last result. If the two numbers are positive, they will pass directly.

Get the result.

--------- Div ---------

MOV AX, 00EFMOV BL, A1DIV BL

Assign the AX assignment, must be 16-bit content. If there is no content, if there is no content, = 0000000011101111Ba1H = 10100001B

-> 00EFH / A1H = 4E01H-> AX = 4E01H

AX / BL ----> Al storer, AH storage

--------- IDIV ---------

MOV AX, 00EFMOV BL, A1DIV BL

Assign the value to the AX, must be 16-bit content. If there is no content, the = 0000000011101111B <---- highest bit 0, indicating positive A1H = 10100001B <---- highest bit 1, indicate negative number

-> (A1H) Supplement = (10100001B) Mix = 101111B = 5FH-> 00EFH / 5FH-> Business is 02D, the remainder is 49d .-> Due to (positive / negative number = negative), the final business is -2d = feH That is, Al = Feh-> Since the number is divided, the remainder is also positive, so the last remainder is 49d = 31h, that is, AH = 31h

Small knot ---- convert the negative number in the two numbers to positive (seeking), then removed, the remainder is stored in AH (DX), and the merchant is placed in Al (AX). If it is a number number, the result should be negative Then, the content of Al (AX) is made to obtain the final business value. If the number is divided, the remainder is also negative, then the content of the AH (DX) is supposed to obtain the final value.

--------- DAA ---------

(Al) <- Put the and adjusted the AL to the compressed BCD format, this instruction must be executed before the ADD or ADC instruction, and the addition instruction must add two compressed BCD code and store the result in the Al register. The adjustment method of this directive is: (1) If the AF flag (auxiliary reassembly) is 1, or the lower 4 bits of the Al register is a hexadecimal AF, the AL register is added to 06h.

And the AF position 1; (2) If the CF flag is 1, or the higher 4 bits of the Al register is a hexadecimal AF, the Al register content is 60h and the CF position 1. (2) DAA instructions is OF The logo is unfained, but affects all other conditional signs.

------- DAS ---------

(Al) <- Adjust the difference in Al to the compressed BCD format, the Sub or SBB instruction must be executed before this instruction, and the subtraction command must

The two BCD code are subtracted and store the results in the Al register. The adjustment method of this instruction is: (1) If the AF flag is 1, or the lower 4 bits of the Al register is a hexadecimal AF, make Al The content of the register is reduced by 06h and the AF will

Location 1; (2) If the CF flag is 1, or the higher 4 bits of the Al register is a hexadecimal A-F, the content of the Al register minus 60 h and will CF

Location 1. (3) DAS instructions are unfained to the OF flag, but affect all other conditional signs.

------- AAA ---------

(Al) <- Put the AL to the non-compressed BCD format (AH) <- (AH) (AH) Establishing the Add or ADC instruction, the addition instruction must put two non-compressed The BCD code is added, and the result is stored in Al

Among the registers. The adjustment step of this directive is: (1) If the lower 4 bits of the Al register are between 0-9, and the AF bit is 0, then (2), execute (3) (2) if the Al register The lower 4 bits are between the hexadecimal AF or AF 1, then the content of the Al register is added 06h, the content of the AH register.

Plus 1, and remove the AF position 1; (3) Clear the value of the high 4 bits (4) AF bits of the Al register to send the CF bit AAA instruction except for the AF and CF flags, and the remaining flags are unfinished.

--------- AAS ---------

(Al) <- Put the difference in Al to the non-compressed BCD format (AH) <- (AH) - Adjust the resulting borrowing value before performing the Sub or SBB instruction, the subtraction command must put two The non-compressed BCD code is reduced, and the result is stored

In the Al register, the adjustment step of this directive is: (1) If the low 4 bits of the Al register are between 0-9, and the AF bit is 0, then skip (2), execute (3) (2) if The low 4 bits of the Al register is between the hexadecimal AF or the AF bit is 1, then subtract the contents of the Al register 06h, AH register

The content is reduced, and the AF position 1 (3) clears the value of the high 4-bit (4) AF bit of the Al register to send CF bit.

转载请注明原文地址:https://www.9cbs.com/read-21393.html

New Post(0)