Author Topic: Reserving memory for struct in bss  (Read 15715 times)

nobody

  • Guest
Reserving memory for struct in bss
« 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

nobody

  • Guest
Re: Reserving memory for struct in bss
« Reply #1 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

nobody

  • Guest
Re: Reserving memory for struct in bss
« Reply #2 on: March 12, 2009, 11:54:20 AM »
Thanks, this works,
Csaba