首页
社区
课程
招聘
[求助]朋友啊!看看我的汇编代码吧!
2006-6-24 23:22 4202

[求助]朋友啊!看看我的汇编代码吧!

2006-6-24 23:22
4202
.386                                
    .model flat, stdcall               
    option casemap :none                  
    include \masm32\include\windows.inc
    include \masm32\include\masm32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc

    includelib \masm32\lib\masm32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\kernel32.lib

    .data
         mystr db "abcd",0
    .code

start:
lea esi,mystr
.WHILE [esi]!=0
inc dword ptr [esi]
inc esi
.ENDW
invoke MessageBox,NULL,addr mystr,NULL,MB_OK
invoke ExitProcess,NULL  
end start

怎么编译老说那个.ENDW那一行有不合法的指令操作数,郁闷啊

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
点赞0
打赏
分享
最新回复 (5)
雪    币: 222
活跃值: (10)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
drwch 3 2006-6-25 01:24
2
0
.WHILE DWORD PTR[esi]!=0
雪    币: 203
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
gkend 2006-6-25 07:59
3
0
.WHILE byte ptr [esi]!=0
inc byte ptr [esi]
inc esi
.ENDWHILE
雪    币: 221
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
vlit 2006-6-25 12:34
4
0
晕啊
怎么编译器不说必须指定类型?
雪    币: 750
活跃值: (228)
能力值: ( LV9,RANK:780 )
在线值:
发帖
回帖
粉丝
非安全 17 2006-7-11 19:52
5
0
.WHILE byte ptr [esi]!=0
inc byte ptr [esi]
inc esi
.ENDW

雪    币: 207
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
AsmCCPlus 2006-7-14 10:40
6
0
最初由 vlit 发布
晕啊
怎么编译器不说必须指定类型?


老兄应该知道呀.....内存中的数与别的进行比较时....是要指写类型的..编译可不知道你是用字节,字..还是双字比较呀.......
如:cmp [esi],0  注会出错了...要求制定类型..
cmp ptr byte[esi],0   or    cmp ptr word[esi],0  or  cmp ptr dword[esi], 0 都是正确的哦..............
游客
登录 | 注册 方可回帖
返回