function CallerOfCaller: pointer; //with stack frames !
asm
cmp ebp, 0 //this can happen when there are no stack frames
je @@EndOfStack
mov eax, [EBP]
cmp eax, ebp
jb @@EndOfStack
mov eax, [eax + 4]
sub eax, 4
ret
@@EndOfStack:
mov eax, $FFFF
end;
function Caller: pointer; //with stack frame !
asm
cmp ebp, 0 //this can happen when there are no stack frames
je @@EndOfStack
mov eax, [ebp + 4]
sub eax, 4
ret
@@EndOfStack:
mov eax, $FFFF
end;