实验11 编写子程序
assume cs:codesgdatasg 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:
push si
push ax
s: ;对拿到的字节进行判断
cmp byte ptr ,60H
jna s0;不大于60H,即小于等于60H
cmp byte ptr ,7BH
jnb s0;如果不小于7BH则跳过转化为大写,即大于等于7BH
;如果是小写字母则转化为大写,即-20H
;如果是大写字符或空格则跳过(不执行)转化为大写
;转化为大写
mov al,
sub al,20H
mov ,al
s0:
cmp byte ptr ,0
je exit;如果是0则退出循环s和函数letterc
inc si
jmp short s
exit:
pop ax
pop si
ret
codesg ends
end begin
页:
[1]