汇编语言(王爽 第三版)实验11 编写子程序

assume cs:code  
data segment  
    db "Beginner's All-purpose Symbolic Instruction Code.",0  
    db 50 dup(0)  
data ends  
  
code segment  
    begin:mov ax,data  
          mov ds,ax  
          mov si,0  
          mov di,50    
            
          call letterc  
            
          mov ax,4c00h  
          int 21h  
     
  letterc:push ax  
          push si  
          push di  
          
      comp:mov al,[si]  
           cmp al,0  
           je exit  
           cmp al,'a'  
           jb next_char  
           cmp al,'z'  
           ja next_char       
             
           and al,11011111b  
             
 next_char:mov [di],al  
           inc si  
           inc di  
           jmp short comp  
             
      exit:pop di  
           pop si  
           pop ax  
           ret      
            
code ends  
end begin

你可能感兴趣的:(汇编语言)