根据入口参数al=0/1/2.分别实现大写转小写。小写转大写,及大小写相互转换
.model small
.stack
.data
sting db 'Hello,EveRybody! ',0
.code
.startup
getagain: mov ah,1
int 21h
cmp al, '0 '
je one
cmp al, '1 '
je two
cmp al, '2 '
je thre
jne getagain
one: call one
jmp done
two: call two
jmp done
three: call three
jmp done
done: .exit 0
one proc
mov dx,offset string
again1: mov al,[bx]
or al,al
jz done
cmp al, 'A '
jb next1
cmp al, 'Z '
ja next1
or al,20h
mov [bx],al
next1: inc bx
jmp again1
one endp
two proc
mov dx,offset string
again2: mov al,[bx]
or al,al
jz done
cmp al, 'a '
jb next2
cmp al, 'z '
ja next2
sub al,20h
mov [bx],al
next2: inc bx
jmp again2
two endp
three proc
mov dx,offset string
again3:mov al,[bx]
or al,al
jz done
cmp al, 'a '
jb next3
cmp al, 'z '
ja next31
sub al,20h
mov [bx],al
next31:inc bx
jmp again3
next3:cmp al, 'Z '
ja next31
cmp al, 'A '
jb next31
or al,20h
mov [bx],al
jmp again3
three endp
end
------解决方案--------------------------------------------------------
je one;到底跳转到哪里?one:和one (proc)不冲突吗?
one: call one
jmp done
one proc