Jose's Read Only Forum 2023

IT-Consultant: Charles Pegge => Assembler => Best place to post any assembler code => Topic started by: Theo Gottwald on May 28, 2007, 10:06:34 PM

Title: How to push VARIANTS with the PB Inline Assembler
Post by: Theo Gottwald on May 28, 2007, 10:06:34 PM
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