[英]Do memory addresses have a different types from an integer type in ATT assembly language?
我知道 ATT 汇编语言有整数类型(字、双字、四字)和浮点类型(单精度、双精度)。
内存地址是整数类型还是它自己的类型?
我看到直接指定了内存地址,而使用前缀$
指定了整数常量。 那是因为整数和内存地址有不同的类型吗?
在 AT&T 语法中,不同的操作数由不同的语法表示:
%eax register operand
(%eax) indirect operand
foo direct operand
$foo immediate operand
foo(%eax) indexed operand
foo(%eax,%ebx,4) scale, index, base operand
所以foo
和$foo
之间的区别在于,前者指的是地址foo
处的内存,而后者指的是foo
的地址。 例如,两者之间的区别
mov 0x1234, %eax
和
mov $0x1234, %eax
是前者将地址0x1234
处的值加载到%eax
而后者加载值0x1234
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.