I go conforme with NichTheQuick!
A short time ago there was a similar problem on the forum, where such a construction caused a problem (but wiht more parameters).
By any reason PB do not check the correctnes of the Parameter.
I remember there was a comment from Fred. But I can't remember it.
C x32, x64
I guess it works in C-Backend. I guess C will use EAX, EDX for the first 2 parameters.
ASM x32, x64
I guess it will work because PB moves anything to the Stack!
here the x64 ASM Output
Code: Select all
; Procedure CallCallback(*var._var, custom_value)
_Procedure6:
MOV qword [rsp+8],rcx ; looks like 1st Parameter to var on Stack
MOV qword [rsp+16],rdx , looks like 2nd Paramenter to var on Stack
PUSH rbp
PS6=64
XOR rax,rax ; RAX = 0
PUSH rax ; 0 to Stack - looks like the custom_value
SUB rsp,40
; *var\callback(custom_value) ; prepare for Call the Callback
MOV rbp,qword [rsp+PS6+0]
PUSH qword [rbp]
SUB rsp,8
PUSH qword [rsp+PS6+24]
POP rcx
SUB rsp,32
CALL qword [rsp+40]
ADD rsp,40
ADD rsp,8
; EndProcedure