我是靠谱客的博主 俊秀帅哥,最近开发中收集的这篇文章主要介绍什么是算术运算和逻辑运算_8086微处理器的算术和逻辑运算,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

什么是算术运算和逻辑运算

逻辑指令 (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.

操作中的至少一个应该是寄存器或内存操作,这两个操作都不能是内存位置或立即操作。

Arithmetic and Logical Operations of 8086 - AND

b) OR: logical OR

b)OR:逻辑或

Both inputs are low in this case

在这种情况下,两个输入均为低电平

Arithmetic and Logical Operations of 8086 - OR

c) NOT: logical invert

c)不:逻辑反转

Arithmetic and Logical Operations of 8086 - NOT

d) XOR: logical Exclusive OR

d)XOR:逻辑异或

Arithmetic and Logical Operations of 8086 - 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,否则结果位为零。

Arithmetic and Logical Operations of 8086 - TEST

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.

它将操作数向左移一位,并将零插入到新引入的最低有效位中。 这里操作不是立即数据。

Arithmetic and Logical Operations of 8086 - SHL

g) SHR: Shift right logical

g)SHR:逻辑右移

Arithmetic and Logical Operations of 8086 - 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(无进位权)

Arithmetic and Logical Operations of 8086 - ROR

j) ROL (Rotate left without carry)

j)ROL(不带进位,向左旋转)

Arithmetic and Logical Operations of 8086 - ROL

k) RCR ( Rotate right through carry)

k)RCR(向右旋转进位)

Arithmetic and Logical Operations of 8086 - RCR

l) RCL (Rotate left through carry)

l)RCL(通过进位向左旋转)

Arithmetic and Logical Operations of 8086 - 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

什么是算术运算和逻辑运算

最后

以上就是俊秀帅哥为你收集整理的什么是算术运算和逻辑运算_8086微处理器的算术和逻辑运算的全部内容,希望文章能够帮你解决什么是算术运算和逻辑运算_8086微处理器的算术和逻辑运算所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(39)

评论列表共有 0 条评论

立即
投稿
返回
顶部