汇编语言(王爽)实验十一

实验十一

编写一个程序,将包含任意字符,以0结尾的字符串中的小写字母转变成大写字母

assume cs:codesg

datasg segment
	db "Beginner's All-purpose Symbolic Instruction Code.",0
datasg ends

codesg segment
	begin:	mov ax,datasg
			mov ds,ax
			mov si,0
			call letterc
			
			mov ax,4c00h
			int 21h
			
  letterc:	push cx
  			mov ch,0
  			
  		s:	mov cl,[si]
  			jcxz endl
  			
  			cmp cl,97
  			jb next
  			cmp cl,122
  			ja next
  			
  			and cl,11011111b
  			mov [si],cl
  			
  	 next:	inc si
  	 		jmp short s
  
  	 endl:	pop cx
			ret
codesg ends
end begin

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