برنامه ای كه 80 كاراكتر را از ورودی بگیرد و حروف اول آنها اگر كوچك بودند به حرف بزرگ تبدیل كند و نمایش بدهد.
PHP Code:
stk segment
dw 64 dup(?)
stk ends
dts segment
max db 81
len db ?
str db 80 dup(?)
dts ends
cds segment
assume ss:stk,ds:dts,cs:cds
main proc far
mov ax,seg dts
mov ds,ax
mov es,ax
mov ah,0Ah
mov dx,offset max
int 21h
mov cl,len
mov ch,0
mov di,offset str
mov al,' '
cld
jmp chk
next:repne scasb
jcxz finish
chk:cmp byte ptr [di],'a'
jb next
cmp byte ptr [di],'z'
ja next
sub byte ptr [di],20h
jmp next
finish: mov byte ptr [di],'$'
mov ah,09
mov dx,offset str
int 21h
mov ah,4ch
int 21h
ret
main endp
cds ends
end main