代码如下

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:
			pushf		; 保存标志寄存器的信息
			push ds
			push si
			
		s:	mov ch,0
			mov cl,ds:[si]
			jcxz ok
			cmp byte ptr ds:[si],61h
			jb s0					; below 低于则转移
			cmp byte ptr ds:[si],7Ah
			ja s0					; above 高于则转移
			and byte ptr ds:[si],11011111b 	; 小写转大写
		s0:	inc si
			loop s
		
		ok:	
			pop si
			pop ds
			popf 		; 还原标志寄存器的信息
			
			ret
codesg ends
end begin

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
相关资源
相似解决方案