文件名称:masm-query
介绍说明--下载内容均来自于网络,请自行研究使用
汇编实现字符查找功能:data segment
word1 db macth! ,0ah,0dh, $
word2 db no match! ,0ah,0dh, $
buffer1 db ? 存入关键字
buffer2 db 20h dup(?)
db 0
db 20h duo(?) 存输入字符,大小可改
data ends
stack1 segment stack
db 200h dup(?)
stack1 ends
code segment
assume cs:code,ss:stack,ds:data
start: mov ax,data
mov ds,ax
mov ah,01h
int 21h
mov buffer1,al 送关键字
mov ah,0ah
int 21h
mov si,02h
mov cl,buffer2+1 置循环值
lp1: mov dl,buffer1
cmp dl,al 比较
icn si
jz disp1 匹配显示match
loop lp1 不匹配继续循环查找
mov dx,offset word2 显示no match
mov ah,09h
int 21h
disp1: mov dx,offset word1
mov ah ,09h
int 21h
mov ah,4ch
int 21h
code ends
end start -data segment
word1 db macth! ,0ah,0dh, $
word2 db no match! ,0ah,0dh, $
buffer1 db ? 存入关键字
buffer2 db 20h dup(?)
db 0
db 20h duo(?) 存输入字符,大小可改
data ends
stack1 segment stack
db 200h dup(?)
stack1 ends
code segment
assume cs:code,ss:stack,ds:data
start: mov ax,data
mov ds,ax
mov ah,01h
int 21h
mov buffer1,al 送关键字
mov ah,0ah
int 21h
mov si,02h
mov cl,buffer2+1 置循环值
lp1: mov dl,buffer1
cmp dl,al 比较
icn si
jz disp1 匹配显示match
loop lp1 不匹配继续循环查找
mov dx,offset word2 显示no match
mov ah,09h
int 21h
disp1: mov dx,offset word1
mov ah ,09h
int 21h
mov ah,4ch
int 21h
code ends
end start
word1 db macth! ,0ah,0dh, $
word2 db no match! ,0ah,0dh, $
buffer1 db ? 存入关键字
buffer2 db 20h dup(?)
db 0
db 20h duo(?) 存输入字符,大小可改
data ends
stack1 segment stack
db 200h dup(?)
stack1 ends
code segment
assume cs:code,ss:stack,ds:data
start: mov ax,data
mov ds,ax
mov ah,01h
int 21h
mov buffer1,al 送关键字
mov ah,0ah
int 21h
mov si,02h
mov cl,buffer2+1 置循环值
lp1: mov dl,buffer1
cmp dl,al 比较
icn si
jz disp1 匹配显示match
loop lp1 不匹配继续循环查找
mov dx,offset word2 显示no match
mov ah,09h
int 21h
disp1: mov dx,offset word1
mov ah ,09h
int 21h
mov ah,4ch
int 21h
code ends
end start -data segment
word1 db macth! ,0ah,0dh, $
word2 db no match! ,0ah,0dh, $
buffer1 db ? 存入关键字
buffer2 db 20h dup(?)
db 0
db 20h duo(?) 存输入字符,大小可改
data ends
stack1 segment stack
db 200h dup(?)
stack1 ends
code segment
assume cs:code,ss:stack,ds:data
start: mov ax,data
mov ds,ax
mov ah,01h
int 21h
mov buffer1,al 送关键字
mov ah,0ah
int 21h
mov si,02h
mov cl,buffer2+1 置循环值
lp1: mov dl,buffer1
cmp dl,al 比较
icn si
jz disp1 匹配显示match
loop lp1 不匹配继续循环查找
mov dx,offset word2 显示no match
mov ah,09h
int 21h
disp1: mov dx,offset word1
mov ah ,09h
int 21h
mov ah,4ch
int 21h
code ends
end start
(系统自动生成,下载前可以参看下载内容)
下载文件列表
汇编实现字符查找功能.txt