首页
社区
课程
招聘
初学汇编,看一下
发表于: 2006-1-21 14:25 4402

初学汇编,看一下

2006-1-21 14:25
4402
datarea segment
  string1 db 'move the cursor backward.'
  string2 db 'move the cursor backward.'

mess1 db 'match.',13,10,'$'
mess2 db 'no match!',13,10,'$'

prognam segment

main proc far
     assume cs:prognam,ds:datarea,es:datarea
start:
     push ds
     sub  ax,ax
     push ax

     mov  ax,datarea
     mov  ds,ax
     mov  es,ax

     lea  si,string1
     lea  di,string2
     cld
     mov  cx,25
     repz cmpsb
     jz   match
     lea  dx,mess2
     jmp  short disp

match:
     lea  dx,mess1
disp:
     mov  ah,09
     int  21h
     ret

main endp

prognam ends
     end  start

这是书上的程序,就是比较两个字符串是否相等,但是用masm编译的时候出了错,我已经和书上对照过了,没错
错误如下

D:\masm32\bin>ml sample.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: sample.asm
sample.asm(41) : fatal error A1010: unmatched block nesting : datarea

请问这是什么原因造成的????

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 291
活跃值: (213)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
2
datarea segment
....
....
....
datarea ends
2006-1-21 17:37
0
游客
登录 | 注册 方可回帖
返回
//