I'm trying to create a demo program demonstrating struct(s) in MASM ,
I've written a code like this :
struct1 struct
first db ?
second dw ?
struct1 EndS
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc ; holds predifned structures
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.data
MessageTitle db "The title",0
MessageText db "The first program which shows simple messagebox",0
.code
start:
Initializedstructure struct1 <'A',1024>
;invoke MessageBox, NULL, addr MessageText, addr MessageTitle, MB_OK
mov eax, struct1.first
;invoke ExitProcess, NULL
end start
but when I disassembled the program I found some kind of instructions that not sensible for initializing the structure of the program :
.text:00401000 start:
.text:00401000 inc ecx
.text:00401001 add [eax+edi*4], al
.text:00401001 ; ---------------------------------------------------------------------------
.text:00401004 dd 7Fh dup(0)
.text:00401200 dd 380h dup(?)
.text:00401200 _text ends
Why MASM assembled the code like this ? I think I've made some mistake in the code,haven't I? I think there's no well-explained document about it ...