data segment
int1 db 30,31 dup(0),’$’
int2 db 30,31 dup(0),’$’
space db 13,10,’$’
data ends
code segment
assume cs:code,ds:data
main:mov dx,data
mov ds,dx
lea dx,[int1]
mov ah,10
int 21h
mov ah,9
lea dx,space
int 21hlea dx,[int2]
mov ah,10
int 21h
mov ah,9
lea dx,space
int 21h
lea si,[int1+2] ;取一个数的偏移地址
mov bh,0
mov bl,[int1+1]
mov [int1+2+bx],’$’
mov dl,bl
lea di,[int2+2]
mov bh,0
mov bl,[int2+1]
mov [int2+2+bx],’$’
mov ah,bl
cmp dl,bl
ja lab
mov bl,dl
lab:mov cx,bx
again:mov al,[si]
mov bl,[di]
cmp al,bl
jl lab1
ja lab2
inc si
inc di
loop again
cmp dl,ah
ja lab2
jmp lab1
lab2: lea dx,[int2+2]
mov ah,9
int 21h
lea dx,space
int 21h
lea dx,[int1+2]
int 21h
jmp abcdlab1:lea dx,[int1+2]
mov ah,9
int 21h
lea dx,space
int 21h
lea dx,[int2+2]
int 21h
abcd:mov ax,4c00h
int 21h
code ends
end main
汇编 输入单词,按字典顺序输出结果(有效果图)
- THE END -
Category: 汇编
发表评论?
Your answer was just what I neeedd. It’s made my day!
Oh, yeah. My name is “TIAN”