flat assembler
Message board for the users of flat assembler.
Index
> Main > Set offset of members in struct? |
Author |
|
revolution 13 May 2016, 14:30
Just use RB:
Code: struct SomeStruct SomeArray dd ? rb 40 SomeOtherValue dd 0 ends Code: struct SomeStruct SomeArray rd 11 SomeOtherValue dd 0 ends |
|||
13 May 2016, 14:30 |
|
MUFOS 13 May 2016, 14:50
I may be picky, but doesn't this mean the program size would be +40 bytes?
You see I never assign struct on compiletime, so is there any way to do it without adding the extra bytes? |
|||
13 May 2016, 14:50 |
|
revolution 13 May 2016, 15:19
It depends upon how you allocate the structure. If you statically add it within your code section, or within the initialised data then it will take up space in the exe file. But you can put it at the end of the data into the uninitialised portion and it won't take up any space in the exe file.
|
|||
13 May 2016, 15:19 |
|
MUFOS 13 May 2016, 15:29
revolution wrote: It depends upon how you allocate the structure. If you statically add it within your code section, or within the initialised data then it will take up space in the exe file. But you can put it at the end of the data into the uninitialised portion and it won't take up any space in the exe file. I would like to allocate it on runtime using the heap. Can you show me an example of uninitialized data? |
|||
13 May 2016, 15:29 |
|
revolution 13 May 2016, 23:35
What OS are you using? What file format?
|
|||
13 May 2016, 23:35 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.