微原循环移位指令_8086微处理器中的移位和旋转指令

news/2024/7/9 22:52:34 标签: webgl, 比特币, asm, etcd, postgresql

微原循环移位指令

As we know that any machine (system) works on machine language, which consists of binary numbers. In the 8086 microprocessor, we have 16-bit registers to handle our data. Sometimes, the need to perform some necessary shift and rotate operations on our data may occur according to the given condition and requirement. So, for that purpose, we have various Shift and Rotate instructions present in the 8086 microprocessor. Let us discuss them one by one and understand their working:

众所周知,任何机器(系统)都可以使用机器语言,该机器语言由二进制数组成。 在8086微处理器中,我们有16位寄存器来处理数据。 有时,根据给定的条件和要求,可能需要对我们的数据执行一些必要的平移和旋转操作 。 因此,为此目的,我们在8086微处理器中提供了各种Shift和Rotate指令。 让我们一一讨论他们并了解他们的工作:

  1. SHR : Shift Right

    SHR:右移

  2. SAR : Shift Arithmetic Right

    SAR:右移算术运算

  3. SHL : Shift Left

    SHL:左移

  4. SAL : Shift Arithmetic Left

    SAL:左移算术

  5. ROL : Rotate Left

    ROL:向左旋转

  6. ROR : Rotate Right

    ROR:向右旋转

  7. RCL : Rotate Carry Left

    RCL:向左旋转

  8. RCR : Rotate Carry Right

    RCR:向右旋转

1)SHR:右移 (1) SHR : Shift Right)

The SHR instruction is an abbreviation for ‘Shift Right’. This instruction simply shifts the mentioned bits in the register to the right side one by one by inserting the same number (bits that are being shifted) of zeroes from the left end. The rightmost bit that is being shifted is stored in the Carry Flag (CF).

SHR指令是“ Shift Right”的缩写。 通过从左端插入相同数量的零(正在移位的位),该指令将寄存器中提到的位简单地一一移位到右侧。 被移位的最右边的位存储在进位标志(CF)中。

Syntax: 	SHR Register, Bits to be shifted
Example:	SHR AX, 2

Working:

加工:

shift and rotate instructions 1

2)SAR:右移算术 (2) SAR : Shift Arithmetic Right)

The SAR instruction stands for ‘Shift Arithmetic Right’. This instruction shifts the mentioned bits in the register to the right side one by one, but instead of inserting the zeroes from the left end, the MSB is restored. The rightmost bit that is being shifted is stored in the Carry Flag (CF).

SAR指令代表“移位算术右移”。 该指令将寄存器中提到的位一一移位到右侧,但是恢复了MSB,而不是从左端插入零。 被移位的最右边的位存储在进位标志(CF)中。

Syntax: 	SAR Register, Bits to be shifted
Example:	SAR BX, 5

Working:

加工:

shift and rotate instructions 2

3)SHL:左移 (3) SHL : Shift Left)

The SHL instruction is an abbreviation for ‘Shift Left’. This instruction simply shifts the mentioned bits in the register to the left side one by one by inserting the same number (bits that are being shifted) of zeroes from the right end. The leftmost bit that is being shifted is stored in the Carry Flag (CF).

SHL指令是“向左移动”的缩写。 通过从右端插入相同的零数(正在移位的位),该指令将寄存器中提到的位简单地一一移至左侧。 被移位的最左位存储在进位标志(CF)中。

Syntax: 	SHL Register, Bits to be shifted
Example:	SHL AX, 2

Working:

加工:

shift and rotate instructions 3

4)SAL:左移算术 (4) SAL : Shift Arithmetic Left)

The SAL instruction is an abbreviation for ‘Shift Arithmetic Left’. This instruction is the same as SHL.

SAL指令是“左移算术”的缩写。 该指令与SHL相同。

Syntax: 	SAL Register, Bits to be shifted
Example:	SAL CL, 2

Working:

加工:

shift and rotate instructions 4

5)ROL:向左旋转 (5) ROL : Rotate Left)

The ROL instruction is an abbreviation for ‘Rotate Left’. This instruction rotates the mentioned bits in the register to the left side one by one such that leftmost bit that is being rotated is again stored as the rightmost bit in the register, and it is also stored in the Carry Flag (CF).

ROL指令是“向左旋转”的缩写。 该指令将寄存器中提到的位一一旋转到左侧,以便将被旋转的最左边的位再次存储为寄存器中的最右边的位,并且还将其存储在进位标志(CF)中。

Syntax: 	ROL Register, Bits to be shifted
Example:	ROL AH, 4

Working:

加工:

shift and rotate instructions 5

6)ROR:向右旋转 (6) ROR : Rotate Right)

The ROR instruction stands for ‘Rotate Right’. This instruction rotates the mentioned bits in the register to the right side one by one such that rightmost bit that is being rotated is again stored as the MSB in the register, and it is also stored in the Carry Flag (CF).

ROR指令代表“右旋转”。 该指令将寄存器中提到的位一一旋转到右侧,以使被旋转的最右边的位再次作为MSB存储在寄存器中,并且也存储在进位标志(CF)中。

Syntax: 	ROR Register, Bits to be shifted
Example:	ROR AH, 4

Working:

加工:

shift and rotate instructions 6

7)RCL:向左旋转 (7) RCL : Rotate Carry Left)

This instruction rotates the mentioned bits in the register to the left side one by one such that leftmost bit that is being rotated it is stored in the Carry Flag (CF), and the bit in the CF moved as the LSB in the register.

该指令将寄存器中提到的位一一旋转到左侧,以使正在旋转的最左边的位存储在进位标志(CF)中,并且CF中的位作为寄存器中的LSB移动。

Syntax: 	RCL Register, Bits to be shifted
Example:	RCL CH, 1

Working:

加工:

shift and rotate instructions 7

8)RCR:向右旋转 (8) RCR : Rotate Carry Right)

This instruction rotates the mentioned bits in the register to the right side such that rightmost bit that is being rotated it is stored in the Carry Flag (CF), and the bit in the CF moved as the MSB in the register.

该指令将寄存器中提到的位旋转到右侧,以使正在旋转的最右边的位存储在进位标志(CF)中,并且CF中的位作为MSB在寄存器中移动。

Syntax: 	RCR Register, Bits to be shifted
Example:	RCR BH, 6

Working:

加工:

shift and rotate instructions 8

翻译自: https://www.includehelp.com/embedded-system/shift-and-rotate-instructions-in-8086-microprocessor.aspx

微原循环移位指令


http://www.niftyadmin.cn/n/1256037.html

相关文章

测试用html

<!DOCTYPE html><html lang"en"><head> <meta charset"UTF-8"> <title>Pandaboy的试验机</title></head><body><div id 唯一的ID身份证>顶部</div>><a href"https://www.…

dbms调度程序_DBMS的用户,应用程序,优缺点

dbms调度程序A database is a collection of related data. It is a collection of facts and figures which can further be used to produce different kinds of information. 数据库是相关数据的集合。 它是事实和数据的集合&#xff0c;可以进一步用于产生各种信息。 The …

本机不装Oracle,使用plsql连接远程Oracle的方法

由于Oracle的庞大&#xff0c;有时候我们需要在只安装Oracle客户端如plsql、toad等的情况下去连接远程数据库&#xff0c;可是没有安装Oracle就没有一切的配置文件去支持。最后终于发现一个很有效的方法&#xff0c;Oracle的Instant client工具包可以很好地解决这个问题&#x…

centos umount 卸载出错

target is busy.(In some cases useful info about processes that usethe device is found by lsof(8) or fuser(1)) 解决 fuser -m -v -i -k /home/wwwroot/在重新卸载 umount /home/wwwroot/ 转载于:https://www.cnblogs.com/buxiangxin/p/8617917.html

getpriority_Java Thread类的最终int getPriority()方法(带示例)

getpriority线程类final int getPriority() (Thread Class final int getPriority()) This method is available in package java.lang.Thread.getPriority(). 软件包java.lang.Thread.getPriority()中提供了此方法。 This method is used to return the priority of this thre…