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
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
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
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
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
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: 7796
Location: Kraków, Poland
Tomasz Grysztar
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
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: 7796
Location: Kraków, Poland
Tomasz Grysztar
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.