opensource 供爱好者修改学习
copyright for 1wangxiaobo@163.com
DATAS SEGMENT
mess db 0dh,0ah, 'welcome you use xiaobo test, quit for q ,enter any going',0dh,0ah,'$'
mess1 db 0dh,0ah, 'please input the first string , end for@ ',0dh,0ah,'$'
mess2 db 0dh,0ah, 'please input the second string , end for@',0dh,0ah,'$'
mess3 db 0dh,0ah, '(same is 1 not is -1 )result:','$'
str1 db 100 dup(?)
str2 db 100 dup(?) ;此处输入数据段代码
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
xiaobo:
MOV AX,DATAS
MOV DS,AX
mov es,ax;切记
.while 1
mov dx,offset mess
mov ah,09h
int 21h
mov ah,01h
int 21h
.break .if al=='q'
lea si,str1
push si
lea di,str2
push di
mov dx,offset mess1
mov ah,09h
int 21h
l1: mov ah,01h
int 21h
cmp al,'@'
jz l2
mov [si],al
inc si
jmp l1
l2: mov dx,offset mess2
mov ah,09h
int 21h
l3: mov ah,01h
int 21h
cmp al,'@'
jz l4
mov [di],al
inc di
jmp l3
l4:
mov dx,offset mess3
mov ah,09h
int 21h
pop di
pop si
mov cl,100
cld
repz cmpsb
jnz l
mov al,01h
mov dl,al
add dl,30h
mov ah,02h
int 21h
jmp exit
l:
mov dl,'-'
mov ah,02h
int 21h
mov al,01h
mov dl,al
add dl,30h
mov ah,02h
int 21h
exit:
.endw
MOV AH,4CH
INT 21H
CODES ENDS
END xiaobo