⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subtwo.asm

📁 从键盘输入一个字符串,先把它原样显示一遍 然后将其中的小写字母转换为大写显示,再将其中的大写字母转换为小写显示,最后将其中的大小写字母互换显示.显示字符串的功能调用采用宏,大写转换,小写转换和大小写互
💻 ASM
字号:
.model small
extern highstr:byte,lowstr:byte,sourstr:byte,converstr:byte
.code
public contohigh,contolow,toconverse
;----------------------------------------------
contohigh proc far
push si
push di
push cx
push ax
	lea si,[sourstr+2]
	lea di,[highstr+2]
	xor cx,cx
	mov cl,[si+1]
  again:cmp cl,0
      	je high_exit
      	mov al,[si]
      	mov [di],al
      	cmp al,'a'
      	jb high_con
      	cmp al,'z'
      	ja high_con
      	sub al,20h
      	mov [di],al
	high_con:
	
			inc di
       inc si
       dec cl
       jmp again
  high_exit:
  pop ax
  pop cx
  pop di
  pop si
     ret
contohigh endp
;----------------------------------------------------
contolow proc far
push si
push di
push cx
push ax
	lea si,[sourstr+2]
	lea di,[lowstr+2]
	xor cx,cx
	mov cl,[si+1]
low_again:cmp cl,0
      	je low_exit
      	mov al,[si]
      	mov [di],al
      	cmp al,'A'
      	jb low_con
      	cmp al,'Z'
      	ja low_con
      	add al,20h
      	mov [di],al
	low_con:
	
			inc di
       inc si
       dec cl
       jmp low_again
  low_exit:
  pop ax
  pop cx
  pop di
  pop si
     ret
contolow endp
;----------------------------------------------------
toconverse proc far
push si
push di
push cx
push ax
	lea si,[sourstr+2]
	lea di,[converstr+2]
	xor cx,cx
	mov cl,[si+1]
 conver_again:cmp cl,0
      	je conver_exit
      	mov al,[si]
      	mov [di],al
      	cmp al,'a'
      	jb hightolow
      	cmp al,'z'
      	ja c_com
      	sub al,20h
      	mov [di],al
      	jmp c_com
	hightolow:
			cmp al,'A'
			jb c_com
			cmp al,'Z'
			ja c_com
			add al,20h
			mov [di],al

	c_com:
			inc di
       inc si
       dec cl
       jmp conver_again
  conver_exit:
  pop ax
  pop cx
  pop di
  pop si
     ret

toconverse endp
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -