当前位置: 代码迷 >> 汇编语言 >> 比较字符串有关问题
  详细解决方案

比较字符串有关问题

热度:9292   发布时间:2013-02-26 00:00:00.0
比较字符串问题
我用的RadASM软件,代码如下:
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,'$'
datarea ends

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 cs,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
错误如下:
...\1.asm(17) : error A2004: symbol type conflict
...\1.asm(38) : error A2148: invalid symbol type in expression : start
请问各位大侠这是什么错误,我按照例题编写的啊……是不是RadASM得有东西设置,还是编写代码的时候有啥主意事项,这是我的第一个汇编代码。。。

------解决方案--------------------------------------------------------
变量类型不对,你可能要强制写一下 word ptr 之类的语句。
  相关解决方案