1

大家好,我在汇编中有这段代码,它应该创建一个消息框,但是当我尝试用 Masm 编译它时

我收到此错误:C:..\test.asm(26) : error A2206: missing operator in expression

.386 .model flat, stdcall

option casemap:none

includelib C:\masm32\lib\kernel32.lib    
includelib C:\masm32\lib\user32.lib    
include C:\masm32\include\kernel32.inc    
include C:\masm32\include\user32.inc    
include C:\masm32\include\windows.inc

.data MsgText db "Hello World!",0

MsgTitle db "My First MessageBox",0

.code

Main:

xor ebx,ebx    
xor ecx,ecx    
push offset MsgTitle ;title    
mov ebx,esp    
push offset MsgText    ;text    
mov ecx,esp    
xor eax,eax       
push eax    
push ebx    
push ecx  
push eax    
xor esi,esi 

**mov esi, 0x7655ea71 (absolute addresses of windows function MessageBoxA within USER32.DLL)**

jmp esi

end Main
4

1 回答 1

6

应该

    mov esi, 7655ea71h

注意h代替0x

于 2013-07-06T15:30:00.147 回答