flat assembler
Message board for the users of flat assembler.

Index > Main > nasm sizeof ?

Author
Thread Post new topic Reply to topic
gavin



Joined: 20 Jul 2008
Posts: 23
gavin
How do i get the size of a struc in nasm?
Example.

Code:
STRUC WSADATA 
  wVersion       resw 1 
  wHighVersion   resw 1 
  szDescription  resb 256+1 
  szSystemStatus resb 128+1
  iMaxSockets    resw 1
  iMaxUdpDg      resw 1
  lpVendorInfo   resw 1
ENDSTRUC
    

Then in my data section i have
Code:
sockAddr dd  SOCKADDR_IN           ; pointer to structure
    


I know masm has the sizeof operator...
Post 26 Jul 2008, 16:01
View user's profile Send private message Reply with quote
asmhack



Joined: 01 Feb 2008
Posts: 431
asmhack
Post 26 Jul 2008, 18:14
View user's profile Send private message Reply with quote
gavin



Joined: 20 Jul 2008
Posts: 23
gavin
I don't understand that .
Post 26 Jul 2008, 18:34
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 313
Mac2004
gavin: Have you read the Fasm manual? The manual descripes what 'virtual' directive does. That could help you to understand the example vid is referring to.

regards,
Mac2004
Post 26 Jul 2008, 18:57
View user's profile Send private message Reply with quote
gavin



Joined: 20 Jul 2008
Posts: 23
gavin
Hi ,
I don't use fasm at all I was just hoping someone would know how to do it in nasm.
Post 27 Jul 2008, 13:20
View user's profile Send private message 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.