What happens to .w and .l ?
Posted: Wed Mar 29, 2006 1:54 am
For my actual project i have defined all my datas as long to the datasection and read all them as long! All the values in the datasection are positiv and no value is bigger as 16000! To save some bytes (maybe 1 alignment, also 512 bytes) to the exe, i tried to define the complete data section to WORD and read them as word.
Normaly each .l value will be stored in 4 bytes and each .w value will be stored in 2 bytes - so the final exe should be possible smaller when using only .w instead storing all the data as long. In my project this is only theoretical and this is the point, i am very confused - because i have strange filesize results here!
filesize: 4096 bytes <-- All datas as WORD !!!!
filesize: 3584 bytes <-- All datas as LONG !!!!
Why is the version, using only longs - 1 alignment (512 bytes) smaller? I have tried to debug the datas for both versions and both version returning all datas correct! Atm this is a bit unlogical for me!
Normaly each .l value will be stored in 4 bytes and each .w value will be stored in 2 bytes - so the final exe should be possible smaller when using only .w instead storing all the data as long. In my project this is only theoretical and this is the point, i am very confused - because i have strange filesize results here!
filesize: 4096 bytes <-- All datas as WORD !!!!
filesize: 3584 bytes <-- All datas as LONG !!!!
Why is the version, using only longs - 1 alignment (512 bytes) smaller? I have tried to debug the datas for both versions and both version returning all datas correct! Atm this is a bit unlogical for me!