Hello again
PureBasic for Windows should support
the calling conventions used by Windows.
Its __stdcall:
|Argument passing order: Right to left
|Called function pops its own ARGs from the stack
Stdcall is used in .DLLs etc...
so if i have to call a DLL, i have
to re-order the stack first.
Code: Select all
> CameraPosition(CAM-Num, x, y, z)
> PB_CameraPosition:
> POP dword [tempadr] ; ReturnAddress
> POP dword [temp01] ; z
> POP dword [temp02] ; y
> POP dword [temp03] ; x
> PUSH dword [temp01] ; z
> PUSH dword [temp02] ; y
> PUSH dword [temp03] ; x
> PUSH dword EAX ; CAM-Num
> CALL [adr_CameraPosition]
> JMP [tempadr]
Code: Select all
| .DESC-File:
| CameraPosition:sdtcall, Long, Long, Long, Long
| None
Code: Select all
> PB_CameraPosition:
> POP dword [tempadr] ; ReturnAddress
> CALL [adr_CameraPosition]
> JMP [tempadr]
Thanks for your attention,
...Danilo
(registered PureBasic user)
Edited by - Danilo on 24 December 2001 03:49:09