我是靠谱客的博主 轻松楼房,这篇文章主要介绍汇编--21H里头0ah功能的使用示例,现在分享给大家,希望可以做个参考。

stacker segment stack
    dw 250h dup(?)
top label word
stacker ends

data segment
str1 db 'please input a string no more than 250 characters',0dh,0ah,24h
str2 db 'the string you have input is',0dh,0ah,24h
str3 db 'the reserve output is',0dh,0ah,24h
buffer db 250
       db ?
       db 250 dup(?)
data ends

code segment
   assume cs:code,ds:data,ss:stacker
start proc near

   mov ax,stacker
   mov ss,ax
   lea sp,top   

   mov ax,data
   mov ds,ax

   lea dx,str1
   mov ah,09h
   int 21h

   lea dx,buffer
   mov ah,0ah
   int 21h

   mov dl,0ah
   mov ah,02h
   int 21h

   lea dx,str2
   mov ah,09h
   int 21h

   mov si,1
   mov bl,buffer[si]
   mov cl,1
   cmp bl,cl
   jb L2
   
L1:
   mov si,cx
   add si,1
   mov dl,buffer[si]
   mov ah,02h
   int 21h
   push dl
   inc cl
   cmp bl,cl
   jae L1

   mov dl,0ah
   mov ah,02h
   int 21h

   lea dx,str3
   mov ah,09h
   int 21h

   mov cl,1
   cmp bl,cl
   jb L2

L3:pop dl
   mov ah,02h
   int 21h
   inc cl
   cmp bl,cl
   jae L3


L2:mov ah,4ch
   int 21h
   
start endp
code ends
   end start

最后

以上就是轻松楼房最近收集整理的关于汇编--21H里头0ah功能的使用示例的全部内容,更多相关汇编--21H里头0ah功能内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(53)

评论列表共有 0 条评论

立即
投稿
返回
顶部