我正在尝试创建一个演示程序来演示 MASM 中的结构,
我写了这样的代码:
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
但是当我反汇编程序时,我发现了一些不适合初始化程序结构的指令:
.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
为什么 MASM 会这样组装代码?我想我在代码中犯了一些错误,不是吗?我认为没有关于它的解释清楚的文件......