Intel and AMD publish very good x86 documentation. Here's a link to an Intels instruction set statement, which (of course) has a section on CALL. http://www.intel.com/design/intarch/manuals/243191.HTM
OP Code: FF /2 Instruction: CALL r/m32 Description: Call near, absolute indirect, address given in r/m32
Using NASM Syntax
lbl_start: MOV EAX, lbl_function1 CALL EAX RETN lbl_function1: MOV EAX, 1 RET 0
If you get an exception, that could mean almost everything. Here are some common problems ...
- you do not set the register to an address inside the program
- you set the value of the register, but it changes when you call the API that happens before your CALL reg32
- you set a register value for data located at a specific address, not the address itself
- You are not correctly encoding your CALL reg32 OP code (for example: FF D0 - CALL EAX in hexadecimal format)
Louis ricci
source share