flat assembler
Message board for the users of flat assembler.

Index > Heap > NASM + Struc ???!!!!!!!!!!

Author
Thread Post new topic Reply to topic
Nameless



Joined: 30 Apr 2010
Posts: 95
Nameless
im trying some assemblers, and im trying to make a small software to change syntax from one assembler to another, but NASM + Struc is like hell for me :S

can some one tell me how to declare an instance of a struct? instance of this struc for example?
Code:
struc MyStruc
 userName: resb 1024
 passWord: resb 512
endstruc
    


ty
Post 01 Oct 2010, 15:11
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6038
Location: Poland
MHajduk
With FASM you can do it this way:
Code:
struct MyStruc 
 userName db 1024 dup (?)
 passWord db 512 dup (?)
ends

X MyStruc    


Last edited by MHajduk on 01 Oct 2010, 15:30; edited 1 time in total
Post 01 Oct 2010, 15:13
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 01 Oct 2010, 15:18
View user's profile Send private message Send e-mail Reply with quote
Nameless



Joined: 30 Apr 2010
Posts: 95
Nameless
MHajduk
yea, but what about NASM?

ouadji
i registered like 10 times, admin requires activation, but no activation emails came for more than 15 days no matter what email i used (Hotmail, Yahoo, Gmail), not even in junk or bulk :S
Post 01 Oct 2010, 15:42
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Try http://www.asmcommunity.net/board/ . Although all assemblers are discussed there, NASM and MASM enjoy far more attention there than here.

PS: And I think that SpooK (the admin), is part of the NASM development team.
Post 01 Oct 2010, 15:44
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Nameless,

NASM struc / istruc combo may look cumbersome at first, it works this way:
Code:
istruc MyStruc
 at userName, db "userName", 0
 at passWord, db "passWord", 0
iend    
Post 01 Oct 2010, 16:07
View user's profile Send private message Reply with quote
Nameless



Joined: 30 Apr 2010
Posts: 95
Nameless
LocoDelAssembly
i figured that out since this forum also wont let me register :S, its the same as NASM forum

baldr
are those are initialization data? cause some struc cant be all filled, for example PROCESSENTRY32 Structure (http://msdn.microsoft.com/en-us/library/ms684839(VS.85).aspx)
no way to declare it without initializing all of its items?
Post 01 Oct 2010, 16:24
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Nameless,

You may omit any (or all) fields' initialization (at macro), they'll get default value.
Post 01 Oct 2010, 17:26
View user's profile Send private message Reply with quote
Nameless



Joined: 30 Apr 2010
Posts: 95
Nameless
ok, ty
Post 01 Oct 2010, 17:37
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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.