flat assembler
Message board for the users of flat assembler.
Index
> Windows > variables? |
Author |
|
r22 03 Jan 2006, 19:53
There are different ways of declaring data.
In your data section if you use dd 0 then that is taking up space whether you use it or not. If you use rd 1 it reserves the space for 1 dword. What your thinking about in C, when you declare a variable it's being created on the stack of the function you dclared it in OR your using memory allocation api's (ie HeapAlloc) to create space in virtual memory for the large variables. Look into the VirtualAllocate api if you want to store data but not in your data section. |
|||
03 Jan 2006, 19:53 |
|
Reverend 04 Jan 2006, 00:59
Variables in C are defined exactly the same way as locals in fasm. Try compiling the same code in C but give 'static' before data definition ie. instead of 'int a;' write 'static int a;' and you'll see the file also got bigger
|
|||
04 Jan 2006, 00:59 |
|
calpol2004 04 Jan 2006, 14:09
thanks for the info.... nothing is ever simple
|
|||
04 Jan 2006, 14:09 |
|
Borsuc 04 Jan 2006, 14:17
If you want small executable, but need a .data buffer, use rb 2000, to reserve bytes, like r22 said.
|
|||
04 Jan 2006, 14:17 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.