Autor Beitrag
Flamefire
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: So 11.10.09 21:29 
In dem assembler Code aus verschiedenen C-programmen sehe ich häufiger solche aufrufe:
ausblenden Quelltext
1:
2:
3:
4:
MOV ECX,yyy
PUSH EAX
PUSH EDX
CALL xyz


also der 1. param ist in ecx gespeichert. der rest aufm stack

kann ich in delphi das genauso machen (kompatiblität wegen einer dll datei auf die ich angewiesen bin)?
mit stdcall haut er alles auf den stack. ohne ist (fast) alles in registern...

wie geths es sauber ohne assembler?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 11.10.09 21:52 
Gib mal bitte die Deklaration der C-Funktionen. Ich vermute aber mal cdecl oder fastcall als Aufrufkonvention.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Flamefire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: So 11.10.09 22:45 
hab den quelltext leider nicht.
nur die binary der dll

es scheint nur bei objekten so zu sein (in meinem fall ist das in ecx der pointer eines objektes) die variablen auf dem stack sind dann werte...

also sowas wie
fooObject.bar(23,66);
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 11.10.09 23:12 
Gibt's beispiel-Source in C? Ggf. den Author bereits angeschrieben gehabt?

Ggf. kann man sich aber auch einen kleinen C-Wrapper für die DLL schreiben ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.