cthree.asm

来自「从键盘输入一个字符串,先把它原样显示一遍 然后将其中的小写字母转换为大写显示,再」· 汇编 代码 · 共 63 行

ASM
63
字号
cmdenter MACRO 
                    mov ah ,02h
                    mov dl ,0dh
                    int 21h
                    mov dl ,0ah
                    int 21h
          ENDM
dispmsg	macro  message	;显示message字符串
	mov dx,offset message
	mov ah,9
	int 21h
	endm
dispmsg1 macro name,length
	local again,quit
	lea si,name+2
	mov cl,length
again:	cmp cl,0
				je quit
				mov dl,[si]
				mov ah,02
				int 21h
				dec cl
				inc si
				jmp again
	quit:
	endm
.model small
.stack
.data
input db 'input a string ',0dh,0ah,'$'
sourstr db 50,0,50  dup(0)
highstr db 50, 0,50 dup(0)
lowstr db 50, 0,50 dup(0)
converstr db 50,0,50 dup(0)
.code
include subone.asm


.startup
dispmsg input
mov dx,offset sourstr
mov ah,0ah
int 21h
cmdenter
mov al,[sourstr+1]
mov [highstr+1],al
mov [lowstr+1],al
mov [converstr+1],al

dispmsg1 sourstr,al;显示输入字符串
cmdenter

call contohigh;把小写转成大写
dispmsg1 highstr,[highstr+1]
cmdenter

call contolow;把大写转成小写
dispmsg1 lowstr,[lowstr+1]
cmdenter
call toconverse;大小写互换
dispmsg1 converstr,[converstr+1]
.exit 0
end

⌨️ 快捷键说明

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