0

Simply, why does not call 12345678 jump to 12345678 address?
Why do I have to use the instruction like this

mov eax, 12345678
call eax

More importantly, what does call 12345678 exactly do?

1

Because of call binary encoding. See the details and properties for intel processors at

Intel manual at page 3-114 Vol. 2A for Intel architecture. If you are talking about different processor, please state which exactly.

| improve this answer | |
  • In the latest Intel Manual this page (3-114 Vol. 2A) refers to the CLI instruction documentation, however just a few pages back (3-96 Vol. 2A; Page 575-580) contains a complete treatment of CALL behavior. – ŹV - Jul 30 '15 at 20:26
0

call 12345678 pushes the following instruction's return address onto the stack and then jumps to 12345678.

It is functionally equivalent to:

mov eax, 12345678
call eax

(Though the code above has the side-effect of modifying eax, whereas a simple call 12345678 does not modify eax.)

| improve this answer | |
  • All variants of call with immediate operands are relative, which may lead to the problem described in the question. The only exception is 9a opcode which is not valid in 64 bit mode. – w s Jul 27 '15 at 14:14
  • Yes, but @FreeMind was asking about the instruction (the "disassembly"), not the machine code. – Jason Geffner Jul 27 '15 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.