movsbl 指令有什么作用? [英] what does movsbl instruction do?

查看:41
本文介绍了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.

推荐答案

Move with sign extend from byte to longword.在 Intel 语法中,这条指令的助记符是 MOVSX.

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

int8_t 类型的变量需要转换为int 时,AC 编译器可能会使用此指令,这会在算术和其他一些操作(整数提升)时自动发生.

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)位而导致的性能损失.一组类似的指令允许扩展零位(Intel 语法中的 MOVZX,AT&T 语法中的 MOVZst(从大小 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天全站免登陆