汇编语言学习(王爽-8086)
实验11:编写一个子程序
- 实验要求
- 代码
assume cs:code,ds:data,ss:stack
;--------------------------------------------------
stack segment
dw 16 dup (0)
stack ends
;--------------------------------------------------
data segment
db 'wel8com9e tGGo maTTs":m!',0
data ends
;--------------------------------------------------
code segment
start: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,0
add sp,32
mov si,0
call Capital
mov ax,4c00h
int 21h
;**********FUNCTION**********
Capital:
push si
push cx
push ax
pushf
mov ch,0
s: mov al,ds:[si]
mov cl,al
jcxz exit
cmp al,61h
jb repeat
cmp al,7Ah
ja repeat
and al,11011111b
mov ds:[si],al
repeat:
inc si
loop s
exit:
popf
pop ax
pop cx
pop si
ret
code ends
;--------------------------------------------------
end start