Page 1 of 1

basic asm question

Posted: Wed May 14, 2003 5:58 am
by kemu
What is the difference between call and jmp they both execute a function ?
Also what does the push command do ?

Re:basic asm question

Posted: Wed May 14, 2003 11:20 am
by Whatever5k
The instruction "jmp" just jumps to the specified address. "call" only calls it, that means it jumpts to it's address, and returns to the old address when a "ret" instruction is issued. This is managed by saving the EIP on the stack and loading EIP with the address to jump to. When the "ret" is issued, EIP is loaded with the value on the stack.
The "push" instruction copies a value on the stack, that is on the memory location of SS:ESP.

Re:basic asm question

Posted: Wed May 14, 2003 1:09 pm
by kemu
You often use the word stack I'm not familair with that word

Re:basic asm question

Posted: Wed May 21, 2003 6:40 am
by Whatever5k
Well, you'll really need to get familiar with it as a programmer. Have a google search.
Simply said, the stack is just a memory region where programs can store and retrieve variables for a short time. When calling a procedure, for example, you push() the parameters to the function on the stack and the function gets them by pop()ing them.
However, do a google search, that's really necessary.