Using more than one ptr$() with invoke does not work, since masm expands the ptr$ macro before the invoke macro.
local v1:qword,v2:dword
invoke target,ptr$(v1),ptr$(v2)
;...
lea rax, [rbp-68h]
lea rax, [rbp-6Ch]
mov rcx, rax
mov rdx, rax
call target
Any workaround?
Use registers for more than one. The macro is only a wrapper for "lea rax, var", mov vptr, rax".
I usually use it for single variables.
mov ptr1, ptr$(var1)
mov ptr2, ptr$(var2)
rcall MyFunc,ptr1,ptr2
With under 5 args, there is a more efficient way.
lea rcx, var1
lea rdx, var2
call MyFunc