在80x86的SHL和SAL之间的区别 [英] Difference between SHL and SAL in 80x86

查看:1931
本文介绍了在80x86的SHL和SAL之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经学会了如何使用80x86的汇编的逐位移位操作工作,所以,我面临着SAL和SHL使用量的问题。我指code线之间的区别如下:

I have learned how to work with 80x86 assembler, so in bit-wise shift operation, i faced a problem with SAL and SHL usage. I means the difference between lines of code as follow :

MOV X, 0AAH
SAL X, 4

MOV X, 0AAH
SHL X, 4

当我们应该用双黄连和使用时SAL?它们有什么不同?

When we should use SHL and when use SAL ? What is the difference of them ?

感谢您的关注:)

推荐答案

根据这个,它们是相同的:

移位算术左(SAL)和转移逻辑左(SHL)
  指令执行相同的操作;它们在转移位
  目标操作数的左侧(朝向更显著位
  位置)。对于每个移位计数,的最显著位
  目标操作数被移入CF标志,并且至少
  显著位被清除(见图7-7中的Intel®64和IA-32
  架构软件Developer'sManual,第1卷)。

The shift arithmetic left (SAL) and shift logical left (SHL) instructions perform the same operation; they shift the bits in the destination operand to the left (toward more significant bit locations). For each shift count, the most significant bit of the destination operand is shifted into the CF flag, and the least significant bit is cleared (see Figure 7-7 in the Intel®64 and IA-32 Architectures Software Developer'sManual, Volume 1).

两者都可能包含只是为了完整性,因为有的为右移的区别。

Both were probably included just for completeness since there is a distinction for right-shifts.

这篇关于在80x86的SHL和SAL之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆