組合語言 王爽(第三版)實驗十一
阿新 • • 發佈:2019-01-29
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],11011111 B
addsi:
inc si
jmp short next
ok:
pop si
pop cx
popf
ret
codesg ends
end begin