Author: Dezhi Zhao
Date: 20:10:15 11/19/02
Go up one level in this thread
Intel coding Rule 6:
Near calls must be matched with near returns, and far calls must be matched with
far returns. Pushing the return address on the stack and jumping to the rontinr
to be called is not recommended since it creates a mismatch in calls and
returns.
This rule sounds simple. However, I'm not sure if the following code comforms to
the above rule.
caller_func
_asm
{
cmp edx, eax
jne taken
jmp func0
taken:
jmp func1
/* pls note that this function do not have a ret instruction in it */
}
func1
_asm
{
/* do sth */
ret
/* func1 is also called by other functions with the call instruction */
}
func2
_asm
{
/* do sth */
ret
/* func1 is also called by other functions with the call instruction */
}
I did some tests with call and jmp, but found no obvious difference there.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.