汇编语言(王爽)-实验11

assume cs:code
data segment
    db "Beginner's All-purpose Symbolic Instruction Code.",0
data ends

code segment

begin:
    mov ax,data
    mov ds,ax
    mov si,0
    call letterc

    mov ax,4c00h
    int 21h

;名称:letterc
;功能:将以0结尾的字符串中的小写字母转变为大写字母
;参数:ds:si指向字符串首地址
letterc:
    push cx
    pushf
    mov cx,0
s1:
    mov cl,ds:[si]
    jcxz ok
    cmp cl,61h
    jb nextgo
    cmp cl,7ah
    ja nextgo
    and cl,0dfh
    mov ds:[si],cl
nextgo:
    inc si
    jmp short s1
ok:
    popf
    pop cx
    ret
code ends
end begin
    
    

 

posted @ 2013-08-30 16:03  tsembrace  阅读(1941)  评论(0编辑  收藏  举报