flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > local variable

Author
Thread Post new topic Reply to topic
afw2004



Joined: 16 Jun 2005
Posts: 49
Location: Kharkov, Ukraine
afw2004 26 Sep 2005, 16:25
How can I declare array of structures as a local variable?

C example:

void myfunc()
{
POINT x[8];
}

How to write this in Fasm?
Post 26 Sep 2005, 16:25
View user's profile Send private message ICQ Number Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 26 Sep 2005, 19:27
Code:
myfunc:
        x       POINT
                rb sizeof.POINT*7    
Post 26 Sep 2005, 19:27
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 26 Sep 2005, 20:14
not quite... in this case he couldn't us "call myfunc". look here, chapter 1.3
Post 26 Sep 2005, 20:14
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
afw2004



Joined: 16 Jun 2005
Posts: 49
Location: Kharkov, Ukraine
afw2004 27 Sep 2005, 07:13
Thanks Smile
Post 27 Sep 2005, 07:13
View user's profile Send private message ICQ Number Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 27 Sep 2005, 18:04
vid: You're right of course. I answered automatically without thinking much about the pasted code Embarassed
Correct one:
Code:
proc    myfunc
  locals
    x   POINT
        rb sizeof.POINT*7
  endl

        ret
endp    
Post 27 Sep 2005, 18:04
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 27 Sep 2005, 18:09
You can do it this way:
Code:
proc myfunc
  local x[8]:POINT

        ret
endp    

see Win32 Headers documentation, section 1.3 - vid already linked it.
Post 27 Sep 2005, 18:09
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 Sep 2005, 10:01
btw, Tomasz: please make anchors (not sure if it is the right word) in the text, so i can link like win32#1_3
Post 28 Sep 2005, 10:01
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 28 Sep 2005, 10:34
Post 28 Sep 2005, 10:34
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.