How do I declare an array of structs in NASM? You know in MASM you would do:
label STRUCTNAME 10 dup (<?>)
Thomas :U
Short answer: you don't :P
The simplest thing to do is define SIZE_STRUCT and then do resb 10*SIZE_STRUCT
If you use struc macro (because is a macro, nasm dosent have direct support for this things, tought I guess that is a failure :P... most by the performance than other things :)) ;)
Anyway, when yu define a struc in nasm like...
struc SName
.firstmember resd 2
.secondMember resw 1
endstruc
is not only defined:
SName.firstmember with a value of 0 and
SName.secondMember with a value of 8
I supose I dont need to explain that to you ;).
But in that macro is also defined another thing, apart of the above.. what???
SName_size with the value of 10 :D. That is done automatically when you use the macro endstruc ;).
Then
startOfArrays: resb 10*SName_size
in the case you whan that space in bss section
or
StartOfArray: times 10*SName_size db 0
in the data section filled with zeros