汇编实验11
assume cs:codedata 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:
s:
mov al,byte ptr
cmp byte ptr ,122;z的10进制
ja hhh
cmp byte ptr ,97;a的10进制
jb hhh
and al,0;判断为0跳出
je exit
and byte ptr ,11011111b
hhh:
inc si
jmp s
exit:
ret
code ends
end begin data segment para public 'DATA'
db "Beginner's All-purpose Symbolic Instruction Code.",0
data ends
stack segment para stack 'STACK'
dw 800h dup(00)
stack ends
code segment para public 'CODE'
assume cs:code , ds:data
letterc proc near
push ax
push si
push di
push es
push ds
popes
push si
pop di
cld
let_01:lodsb
or al,al
jz let_03
cmp al,'a'
ja let_02
cmp al,'z'
jb let_02
sub al,20h
let_02:stosb
jmp short let_01
let_03:pop es
pop di
pop si
pop ax
ret
letterc endp
main proc far
mov ax,data
mov ds,ax
mov si,0
call letterc
mov ax,4c00h
int 21h
main endp
code ends
end main
页:
[1]