• Welcome to Jose's Read Only Forum 2023.
 

How to push VARIANTS with the PB Inline Assembler

Started by Theo Gottwald, May 28, 2007, 10:06:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

Just learned something from Jose.

The question was:

How to push VARIANT variables (16 bytes), both by value and by reference, using the PB inline assembler?

Needless to say that Jose got it.

By reference is easy:

mov eax, v
push eax

By value:

SUB Foo (BYVAL v AS VARIANT)
  !lea eax, v
  !mov ecx, [eax+12]
  !push ecx
  !mov ecx, [eax+8]
  !push ecx
  !mov ecx, [eax+4]
  !push ecx
  !mov ecx, [eax]
  !push ecx
END SUB