【问题标题】:probleme with error A2206: missing operator in expression出现错误 A2206 的问题:表达式中缺少运算符
【发布时间】:2013-07-06 15:21:56
【问题描述】:

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

我收到此错误:C:..\test.asm(26):错误 A2206:表达式中缺少运算符

.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

【问题讨论】:

    标签: assembly masm


    【解决方案1】:

    应该是

        mov esi, 7655ea71h
    

    注意h 而不是0x

    【讨论】:

    • 您也可以删除 DWORD PTR 位,只需使用正确的十六进制值表示法。我在 masm32 上对其进行了测试,它在这里工作。
    • 顺便说一句,如果数字的第一个字符是 A-F,则必须有前导 0。如果是数字,就像在您的示例中一样,您也可以拥有它,但不需要.
    猜你喜欢
    • 2015-12-15
    • 1970-01-01
    • 2019-07-18
    • 1970-01-01
    • 2020-01-14
    • 2018-09-02
    • 2018-01-29
    • 2012-11-14
    相关资源
    最近更新 更多