汇编达人帮帮忙,小问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 11:35:40
刚写了个小程序,但出了点问题,帮忙看一下,是输入两个字符串,看第一个字符串内是否含有第一个字符串,代码如下:

.model small
.stack 400h
.data
temp dw 0

String1 db 100,?,100 dup(?)
String2 db 100,?,100 dup(?)

prompt1 db 'Please input string:$'
prompt2 db 0ah,0dh,'Input the sub string:$'

matchstr db 0ah,0dh,'match at','$'
nomatchstr db 0ah,0dh,'No match',0ah,0dh,'$'

quit db "press any key to exit......",13,10,'$'

.code
start:
MOV AX,@DATA
MOV DS,AX
mov dx,offset prompt1
mov ah,09h
int 21h
mov dx,offset String1
mov ah,0ah
int 21h

mov dx,offset prompt2
mov ah,09h
int 21h
mov dx,offset String2
mov ah,0ah
int 21h

mov cl,String1+1
mov dl,string2+2

ag1:
cmp dl,string1+2
jne next1
jmp comps

next1:
add string1,1
loop ag

分挺诱人的 就是太难了

哈哈你怎么编写程序的,我晕连点注释都没有,mov cl,String1+1
mov dl,string2+2

ag1:
cmp dl,string1+2
jne next1
jmp comps
这快有错误,底下还有,你加我把qq:669034580我可以免费帮你编写汇编程序