News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Replace std::vector with ...?

Started by D.F., October 30, 2011, 03:29:40 PM

Previous topic - Next topic

D.F.

Hi all,
I'm porting application in C++ to MASM. In my C++ application I have:
vector<PESection *> Sections;
How to write this in MASM?

Regards, David

qWord

Sections is a pointer to a dynamic pointer-array:
mov edi,alloc(SIZEOF PVOID)
; edi = Sections = ptr ptr PESection 
; PVOID ptr [edi][0] = ptr PESection 
FPU in a trice: SmplMath
It's that simple!

ToutEnMasm


Better than answer questions one by one add:
/FA           in  project ---->Property ---> c++ --->commande line
Build the project
open  a file and you got an asm file like this:
Quote
; Line 58
   push   OFFSET $SG4191
   mov   eax, DWORD PTR _p1$[ebp]
   push   eax
   call   _strcpy
   add   esp, 8
; Line 60
   push   34               ; 00000022H
   call   _malloc
   add   esp, 4
   mov   DWORD PTR _p2$[ebp], eax
And all your questions are answered


D.F.