Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
346 Beiträge
 
#30

AW: In Asm-Prozedur eine Exception auslösen

  Alt 10. Nov 2023, 13:40
@Kas Obi:

I think, the stack is need under modern Microsoft Windows.
Because the first two 8 Bit = 16 Bit = 10h is for 64-Bit self-references the Functions, and Procedures.
So the first Argument/Parameter for the Function's/Procedure's begin at Bit 16.
I say to me:
Code:
first := 0 <-- self
second := 1 <-- first Parameter
...
I am not sure i do understand that %100, but Self will be used and added ONLY in Objects and Classes when the code is used in OOP style, not in orphan procedures/functions like all the mentioned p/f in this thread.

Example
Code:
function MyFunc(A: Integer; B: string): Integer;
begin

end;
 // Internally the compiler will make generate the code exactly as the following

procedure MyFuncAsProc(A: Integer; B: string; out Result: Integer);
begin

end;

------------------------

function MyClass.MyFunc(A: Integer; B: string): Integer;
begin

end;
 // Internally the compiler will make generate the code exactly as the following

procedure MyClass.MyFuncAsProc(const Self: TMyClass; A: Integer; B: string; out Result: Integer);
begin

end;
So using the satck is not for only referencing Self, in fact Self will always be in a register.( in edx on x86/x32, and in rcx on x64)

and that if i understand your comment right and we are talking about Self like This in other languages.
Kas
  Mit Zitat antworten Zitat