Hi Guys,
What is the difference between .data and .data?
Wouldn't it be better to initialise all data to zero in .data instead of the latter? Or does this somehow affect executable size?
; Why not do this?
.data
hWnd DWORD 0
hHeap DWORD 0
msg MSG <0>
; Instead of doing this?
.data?
;hHeap DWORD ?
;hWnd DWORD ?
;msg MSG <?>
Thanks in advance :)
Quote from: Lonewolff on March 16, 2016, 09:18:05 AMOr does this somehow affect executable size?
It does indeed. Try yourself:
include \masm32\include\masm32rt.inc
.data
MyArray dd 250000 dup(0)
.code
start:
MsgBox 0, str$(sizeof MyArray), "Bytes initialised:", MB_OK
exit
end start
So with '.data?' does this just allocate a space in RAM that can be filled in later on?
Exactly. It must be one of the *Alloc functions doing that during process startup.