📄 subtwo.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 + -