什么是算術運算和邏輯運算
邏輯指令 (Logical Instructions)
a) AND: Logical AND
a)AND:邏輯AND
Atleast one of the operant should be a register or a memory operant both the operant cannot be a memory location or immediate operant.
操作中的至少一個應該是寄存器或內存操作,這兩個操作都不能是內存位置或立即操作。
b) OR: logical OR
b)OR:邏輯或
Both inputs are low in this case
在這種情況下,兩個輸入均為低電平
c) NOT: logical invert
c)不:邏輯反轉

d) XOR: logical Exclusive OR
d)XOR:邏輯異或

e) TEST instruction: Logical compare instruction
e)TEST指令:邏輯比較指令
It will do bit by bit AND operation on the operands. Each bit of the result is then said to be 1 if the corresponding bit else the result bit is said to zero.
它將對操作數進行逐位AND運算。 如果相應的位則結果的每一位都為1,否則結果位為零。
f) SHL: Shift left logical
f)SHL:邏輯左移
It will shift the operant bit by bit to the left and insert the zero in the newly introduced least significant bits. Here operant is not an immediate data.
它將操作數向左移一位,并將零插入到新引入的最低有效位中。 這里操作不是立即數據。
g) SHR: Shift right logical
g)SHR:邏輯右移
h) SAR: Shift Right Arithmetic
h)SAR:右移算術
Same as the logical shift but it inserts the most significant bit of the operand in the newly inserted position.
與邏輯移位相同,但它將操作數的最高有效位插入到新插入的位置。
i) ROR (Rotate Right without carry)
i)ROR(無進位權)

j) ROL (Rotate left without carry)
j)ROL(不帶進位,向左旋轉)

k) RCR ( Rotate right through carry)
k)RCR(向右旋轉進位)
l) RCL (Rotate left through carry)
l)RCL(通過進位向左旋轉)

算術運算 (Arithmetic Operations)
(1) ADD
(1)添加
In this operation we perform sum of data in two different registers.
在此操作中,我們在兩個不同的寄存器中執行數據求和。
Memory to memory operation is not possible. Source and destination operant cannot be a memory location.
內存到內存操作是不可能的。 源和目標操作數不能是存儲位置。
Also the content of segment register cannot be added.
同樣,段寄存器的內容也不能添加。
(2) ADC ( Add with carry)
(2)ADC(加進位)
Same as add instruction, but adds the carry flag bit.
與添加指令相同,但加進位標志位。
(3) INC ( Increment)
(3)INC(增量)
Increment the data by 1 and immediate data cannot be an operand here.
將數據加1,立即數不能在此處作為操作數。
(4) DEC ( decrement by 1)
(4)DEC(減1)
Decreases data by 1 and immediate data cannot be an operand.
將數據減1,立即數不能是操作數。
(5) SUB
(5)SUB
It will subtract source operand from destination and result is stored in destination.
它將從目標中減去源操作數,結果存儲在目標中。
Both operands may not be a memory operand and destination operand must not be an immediate data.
這兩個操作數都可能不是內存操作數,目標??操作數也不能是立即數。
(6) SBB (Subtract with borrow)
(6)SBB(減去借方)
Borrow flag/ Carry flag is also subtracted.
借位標志/進位標志也被減去。
(7) CMP (compare)
(7)CMP(比較)
For comparison it subtract source operand from the destination, but result is not stored anywhere.
為了進行比較,它從目標中減去源操作數,但結果未存儲在任何地方。
(8) ASS (ASCII adjust AL after subtraction)
(8)ASS(減法后的ASCII調整AL)
It converts the result of subtraction of two valid unpacked BCD digits to a single valid BCD no. and takes AL as implicit operand.
它將兩個有效的未打包BCD數字相減的結果轉換為一個有效的BCD號。 并將AL作為隱式操作數。
(9) AAM (ASCII adjust after multiplication)
(9)AAM(乘法后進行ASCII調整)
AAM converts the result of multiplication of two valid BCD digits to a single valid BCD no. takes AC as implicit operand.
AAM將兩個有效BCD數字相乘的結果轉換為單個有效BCD號。 將AC作為隱式操作數。
It unpacks the result by dividing AX by 10 placing the quotient into AH and remainder in AL.
它通過將AX除以10來分解結果,將商放入AH并將余數放在AL中。
(10) AAD (ASCII adjust before division)
(10)AAD(除法ASCII調整)
It converts unpacked BCD digits in AH and AL register in a single binary number in AX register in preparation for a division operation.
它將AH和AL寄存器中未打包的BCD數字轉換為AX寄存器中的單個二進制數,以準備除法運算。
Before executing AAD placed most significant BCD digit in the AH register and least significant digit in AL register. Then the two BCD digits are combined in a single binary number by setting.
在執行AAD之前,將最高有效的BCD數字放入AH寄存器,將最低有效的數字放入AL寄存器。 然后通過設置將兩個BCD數字組合為一個二進制數。
(11) DAA (Decimal adjust accumulator)
(11)DAA(十進制調整累加器)
Used to convert the result of the addition of 2 packed BCD no. to valid BCD no. if lower nibble AL > 9.
用于轉換添加2個壓縮BCD編號的結果。 到有效的BCD號 如果下半字節AL> 9。
(12) DAS (Decimal address after subtraction)
(12)DAS(減后的十進制地址)
It converts the result of subtraction of two packed number to a valid BCD no.
它將兩個打包數字相減的結果轉換為有效的BCD號。
Conclusion:
結論:
In this article I have discussed briefly about almost all arithmetic and logical instructions of 8086 microprocessor. I hope they have covered all we need to know about the operations performed by 8086 microprocessor if you have any further queries shoot them in the comment section below. See you in my next article till then stay healthy and keep learning!
在本文中,我簡要討論了8086微處理器的幾乎所有算術和邏輯指令 。 我希望它們涵蓋了我們需要了解的關于8086微處理器執行的所有操作,如果您有其他疑問,請在下面的評論部分中進行介紹。 在下一篇文章中再見,然后保持健康并繼續學習!
翻譯自: https://www.includehelp.com/embedded-system/arithmetic-and-logical-operations-of-8086-microprocessor.aspx
什么是算術運算和邏輯運算