什么movsbl指令呢? [英] what does movsbl instruction do?

查看:1382
本文介绍了什么movsbl指令呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上搜索,但我无法找到一个明确的例子就明白了什么呢该指令去做。所以,如果有人可以给这个一个例子,这将是对我很大的帮助。

I have searched on the net, but i couldn't find a clear example to understand what does this instruction do. So, if someone can give an example about this, it will be very helpful to me.

推荐答案

有符号移动从字节扩展到长字。在Intel语法,此指令的助记符是MOVSX。

Move with sign extend from byte to longword. In Intel syntax, the mnemonic of this instruction is MOVSX.

C编译器可以使用这个指令自动算术和其他一些操作(整数推广)。

A C compiler may use this instruction when a variable of type int8_t needs to be converted to int, which happens automatically on arithmetic and a few other operations (integer promotion).

由于该指令写入到目的寄存器的所有32(或64)位,它避免了性能损失可能导致的写入只有一个寄存器的低位8(或16)个比特。类似的指令集,允许零位扩展(MOVZX在Intel语法,MOVZst在AT& T公司的语法(从大小s到大小T))。

Because this instruction writes to all 32 (or 64) bits of the destination register, it avoids performance penalties that may result from writing to only the low 8 (or 16) bits of a register. A similar set of instructions allows extending with zero bits (MOVZX in Intel syntax, MOVZst in AT&T syntax (from size s to size t)).

这篇关于什么movsbl指令呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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