NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: nobody on March 12, 2009, 08:59:03 AM

Title: Reserving memory for struct in bss
Post by: nobody on March 12, 2009, 08:59:03 AM
Hi,

Please could you help me how can I reserve memory for a struct in the bss section.

I f I add the code like this:
"
section .bss

myInstance istruc myStruct
"

than no memory is reserved I just got a label myInstance which reserves 0 bytes.

Thanks,
Csaba
Title: Re: Reserving memory for struct in bss
Post by: nobody on March 12, 2009, 11:42:26 AM
section .bss
    myinstance resb myStruct_size

That would be an instanciated, but uninitialized structure. "istruc" would be for an initialized one, and would want to be in a .data section.

Best,
Frank
Title: Re: Reserving memory for struct in bss
Post by: nobody on March 12, 2009, 11:54:20 AM
Thanks, this works,
Csaba