汇编语言 王爽(第三版)实验十一

assume cs:codesg

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

stack segment
    db 16 dup(0)
stack ends

codesg segment
    begin:
        mov ax,stack
        mov ss,ax
        mov sp,16
        mov ax,datasg
        mov ds,ax
        mov si,0
        call letterc

        mov ax,4c00h
        int 21h

    letterc:
        pushf
        push cx
        push si
        next:
            mov ch,0
            mov cl,ds:[si]
            jcxz ok
            cmp byte ptr ds:[si],61h
            jb addsi
            cmp byte ptr ds:[si],7Ah
            ja addsi
            and byte ptr ds:[si],11011111B
            addsi:
                inc si
                jmp short next
        ok:
            pop si
            pop cx
            popf
        ret
codesg ends
end begin

你可能感兴趣的:(汇编语言)