x86汇编中的美元($)和百分比(%)符号代表什么? [英] What do the dollar ($) and percentage (%) signs represent in x86 assembly?

查看:1597
本文介绍了x86汇编中的美元($)和百分比(%)符号代表什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解汇编语言如何用于微型计算机体系结构类,并且在示例中始终面对不同的语法:

I am trying to understand how the assembly language works for a micro-computer architecture class, and I keep facing different syntaxes in examples:

sub $48, %esp
mov %eax, 32(%esp)

这些代码是什么意思? esp寄存器的32位操作数是什么?

What do these codes mean? What is the 32 operand an addition to the esp register?

推荐答案

那不是Intel语法,其 AT& T语法,也称为 GAS语法.

Thats not Intel syntax, its AT&T syntax, also called GAS syntax.

$前缀用于立即数(常量),%前缀用于寄存器(它们是必需的 1 ).

the $ prefix is for immediates (constants), and the % prefix is for registers (they are required1).

有关AT& T语法的更多信息,另请参见 [att]标签Wiki .

For more about AT&T syntax, see also the [att] tag wiki.

1 除非指定了noprefix选项,否则请参见此处.但是通常noprefix仅与.intel_syntax noprefix一起使用,以获得类似于MASM的语法.

1 Unless the noprefix option is specified, see here & here. But usually noprefix is only used with .intel_syntax noprefix, to get MASM-like syntax.

这篇关于x86汇编中的美元($)和百分比(%)符号代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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