I have been trying to learn to write assembly code for the AMD64 processor. I have been looking at code generated by gcc. Eventually, I began seeing instructions such as
call *(%rax)
What is the * doing in front of the operand? Something like this came up in the System V ABI document I'm reading, and the answer to the above will help me continue on. Here is an example of the syntax used in context, taken from the System V ABI document itself:
// System V ABI suggested implementation of a
// C switch statement with case labels 0, 1, and 2,
// and a default label.
// Jump to the default case if the control variable is
// less than 0.
cmpl $0, %eax
jl .Ldefault
// Jump to the default case if the control variable is
// greater than 2.
cmp $2, %eax
jg .Ldefault
movabs $.Ltable, %r11
jmpq *(%r11,%eax,8) /* Here is that syntax. */
.section .lrodata,"aLM",@progbits,8
.align 8
.Ltable: .quad .Lcase0
.quad .Ldefault
.quad .Lcase2
.quad .previous
.Ldefault:
// Code for default case
.Lcase0:
// Code for case 0
.Lcase1:
// Code for case 1
.Lcase2:
// Code for case 2