什么是算术运算和逻辑运算_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

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/542683.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python文件读写用到的库_Python使用pyshp库读取shapefile信息的方法

通过pyshp库,可以读写shapefile文件,查询相关信息,github地址为 import shapefile # 使用pyshp库 file shapefile.reader("data\\市界.shp") shapes file.shapes() # print(file.shapetype) # 输出shp类型null 0 point 1 poly…

h5引入json_Vue中如何使用本地Json文件?

我需要将菜单配置成Json文件,然后再程序中引入{{menu.name}}import menuListConfig from ../../config/menu.jsonexport default {name: "Sider",data(){return {menuList:JSON.parse(JSON.stringify(menuListConfig))}}}需要如何做,才能v-for…

深入学习jQuery选择器系列第四篇——过滤选择器之属性选择器

前面的话 属性过滤选择器的过滤规则是通过元素的属性来获取相应的元素,对应于CSS中的属性选择器。属性过滤选择器可分为简单属性选择器、具体属性选择器和条件属性选择器三种。本文将详细该部分内容 简单属性选择器 [attribute] [attribute]选择器选择拥有该属性的元…

c++ scanf读取_使用scanf()读取内存地址并在C中打印其值

c scanf读取Here, we have to input a valid memory address and print the value stored at memory address in C. 在这里,我们必须输入一个有效的内存地址并在C中打印存储在内存地址中的值。 To input and print a memory address, we use "%p" format…

python正则匹配_Python正则表达式只匹配一次

我正在尝试创建一个简单的降价乳胶转换器,只是为了学习 python和基本的正则表达式,但我不知道试图弄清楚为什么下面的代码不起作用: re.sub (r\[\*\](.*?)\[\*\]: ?(.*?)$, r\\footnote{\2}\1, s, flagsre.MULTILINE|re.DOTALL) 我想转换像: s "…

Virtual Network (1) - How to use it in a guest

本文将讲述一个问题:kvm guest使用libvirt xml定义如何使用virtual network?1)nat, route ,isolated, open类型在host中定义virtual network会创建一个虚拟的bridge,相当于一个交换机。guest只需要连接到这…

java string做除法_如果用java来实现传统方式的除法,用String来保存结果,想精确多少位都行,那改怎么做?...

我会加分的,提个思路都行,目前做了个乘法和加法,但是现在对除法没有什么思路。以下是我编写的功能:publicclassCalculator{publicstaticStringmulti(Strings1,Strings2){if(s1nu...我会加分的,提个思路都行&#xff0c…

c语言数组的声明和初始化_C声明和初始化能力问题和解答

c语言数组的声明和初始化This section contains aptitude questions and answers on C language Declarations and Initialization. 本节包含有关C语言声明和初始化的适切性问题和解答。 1) What will be the output of following program ? int main(){int m10;int xprintf(…

python2和python3的默认编码_python2和python3哪个版本新

Python2 还是 Python3 ? py2.7是2.x系列的最后一个版本,已经停止开发,不再增加新功能。2020年终止支持。 所有的最新的标准库的更新改进,只会在3.x的版本里出现。Python3.0在2008年就发布出来,而2.7作为2.X的最终版本并…

html-css样式表

一、CSS:Cascading Style Sheet—层叠样式表,其作用是美化HTML网页。 样式表分类:内联样式表、内嵌样式表、外部样式表 1、内联样式表 和HTML联合显示,控制精确,但是可重用性差,冗余多。 例如:&…

java 栈 先进后出_栈先进后出,堆先进先出

1.栈(stack)与堆(heap)都是Java用来在Ram中存放数据的地方。与C不同,Java自动管理栈和堆,程序员不能直接地设置栈或堆。2.栈的优势是,存取速度比堆要快,仅次于直接位于CPU中的寄存器。但缺点是,存在栈中的数据大小与生…

c#给定二维数组按升序排序_在数组中按升序对数字进行排序| 8086微处理器

c#给定二维数组按升序排序Problem: Write a program in 8086 microprocessor to sort numbers in ascending order in an array of n numbers, where size n is stored at memory address 2000 : 500 and the numbers are stored from memory address 2000 : 501. 问题&#xf…

使用python套用excel模板_Python自动化办公Excel-从表中批量复制粘贴数据到新表

1、模块安装 1)cmd模式下: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xlrd pip install -i https://pypi.tuna.tsinghua.edu.cn/simple openpyxl 2)如果有安装Pycharm,则在程序中操作如下: 菜单栏&…

在HubSpot是如何应对Fat JAR困境的

在七月底,Spring Boot和Dropwizard分别发布了1.4和1.0版本,它们都是基于Fat JAR的。随着人们更多地采用这些框架和微服务架构,Fat JAR成为了通用的部署机制。\\Fat JAR技术会将Java应用的所有依赖打包到一个bundle之中,便于执行&a…

给定数字的b+树创建_在C ++中找到给定数字中的两个的下一个和上一个幂

给定数字的b树创建Problem statement: 问题陈述: Find Next and previous power of two of a given number 查找给定数字中两个的下一个和上一个幂 Next power of two 下一个二的幂 Example(1):input: 22output: 32 ( as 32 is 2^5)Example(2):input: 54output…

java 字节数组作用_这段java代码中字节数组b起到了什么作用?

importjava.io.*;importjavax.swing.*;publicclassIOMonitor{publicstaticvoidmain(String[]temp){//TODO自动生成的方法存根byteb[]newbyte[2];try{FileInputStreamfisnewFileInput...import java.io.*;import javax.swing.*;public class IOMonitor {public static void main…

如何查看本地的崩溃log_过年回家,还怕抢不到票?程序员教你如何抢票

2019年接近尾声,距离春节回家的日子越来越近,26日起,2020年除夕火车票正式开售,抢票大战也进入白热化阶段。是否为某抢票 App 加速而烦恼,是否为车票“秒光而烦恼”。别慌,作为连“对象”都是 new 出来的程…

获取列表中包含的元素数 在C#中

Given a list, and we have to count its total number of elements using List.Count property. 给定一个列表,我们必须使用List.Count属性计算其元素总数 。 C#清单 (C# List) A list is used to represent the list of the objects, it is represent…

I00037 亏数(Deficient number)

数论中,若一个正整数除了本身之外所有因子之和比此数自身小,则称此数为亏数。亏数(Deficient number)也称为缺数,参见百度百科_亏数,或参见维基百科的Deficient number。亏数在OEIS中的数列号为A005100。 问…

hashmap转红黑树的阈值为8_面试必考的 HashMap,这篇总结到位了

点击蓝色“JavaKeeper”关注我哟加个“星标”,一起成长,做牛逼闪闪的技术人1 概述HashMap是基于哈希表实现的,每一个元素是一个key-value对,其内部通过单链表解决冲突问题,容量不足(超过了阀值)时,同样会自动增长.HashMap是非线程安全的,只适用于单线程环…