I am new to assembly language and a bit confused about what is considered an "immediate value" in AT&T syntax. Specifically, I understand that "$" is used to either represent an immediate value or an address and "%" is used to represent registers, but then I come to accessing elements of "arrays":
movl mem_location(%ebx,%ecx,4), %eax
Why doen't this number 4 have "$" before it, isn't it an immediate value?
Thank you for your time
I think you misunderstand the meaning of immediate value. Immediate value means the value is included on the opcode. If it refers to memory (array) or registers, it is not immediate. As Jester points out, the 4
is actually a scale factor for memory addressing. This is not considered an immediate value.
An example of immediate value would be something like mov eax, 123
.
Also note that immediate value is an assembly concept (it applies to a lot of architectures), not something specific to AT&T syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With