实验十一:编写子程序

October 15, 2013
masm

将一个0结尾的字符串中的小写字母转化成大写字母

assume cs:code, ds:data

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

code segment
start:
    mov ax, data
    mov ds, ax
    mov si, 0
    call letterc

    mov ax, 4c00h
    int 21h

letterc:
    mov cx, 0
sad:
    mov cl, [si]
    jcxz llh
    cmp cl, 7ah
    ja next
    cmp cl, 61h
    jb next
    and cl, 11011111b
    mov [si], cl
next:
    inc si
    jmp sad
llh:
    ret

code ends

end start

这货并不复杂……=_= 都是基本的应用

comments powered by Disqus