0

This is the source of confusion: movl (%edx), %eax This treats the value of %eax as an address, goes to it and copies its content to %eax,

Keeping that in mind then looking at: jmp *(%edx) Since parenthesis was used earlier (as dereferencing in the mov instruction), then is the asterisk a form of double dereference ?

...and how would this instruction perform differently ? --> jmp (%edx)

...or what about jmp *%edx versus jmp %edx ?

Gunner
  • 5,780
  • 2
  • 25
  • 40
Thomas An
  • 503
  • 2
  • 7
  • 17
  • This is AT&T syntax, please keep it tagged that way. – Gunner Oct 07 '13 at 01:36
  • Your first statement.. I think its a typo... Did you mean: "It treats the values of `%edx` as an address, goes to it and copies its contents to `%eax`" – Sam Oct 29 '13 at 10:09
  • You can check with a disassembler to see the last 2 are the same, and see the warning GAS prints about an indirect jump without `*`. The only ambiguity is `jmp foo` (rel32) vs. `jmp *foo` (load from absolute address `foo` into EIP/RIP). – Peter Cordes May 31 '22 at 05:05

1 Answers1

0

The * indicates an absolute jump, in contrast with the absense of the asterisk meaning a relative jump. See http://sourceware.org/binutils/docs-2.17/as/i386_002dMemory.html#i386_002dMemory

However, I don't know whether the assembler infers the absolute jump from the indirection even if the * is missing or it barks on the impossibility of an indirect relative jump.

Laszlo Valko
  • 2,683
  • 25
  • 29