什么是算術運算和邏輯運算_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.pswp.cn/news/542683.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/542683.shtml
英文地址,請注明出處:http://en.pswp.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是非線程安全的,只適用于單線程環…