x86汇编中的美元($)和百分比(%)符号代表什么? [英] What do the dollar ($) and percentage (%) signs represent in x86 assembly?
问题描述
我试图了解汇编语言如何用于微型计算机体系结构类,并且在示例中始终面对不同的语法:
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屋!