.Model Small
.code
org 100h
start :
jmp mulai
welcome DB 'Program Untuk Mengkonversi'
DB 13,10,'Kalimat dari huruf besar ke'
DB 13,10,'kecil dan sebaliknya'
DB 13,10,'===========================',13,10,'$'
tanya DB 'Masukkan suatu kalimat : $'
buffer DB 30,?,30 DUP (?)
kal_konv DB 13,10,'Kalimat yang sudah dikonversi : $'
mulai :
mov ah,09
lea dx, welcome
int 21h
mov ah,09
lea dx, tanya
int 21h
mov ah,0Ah
lea dx, buffer
int 21h
mov ah,09
mov dx, offset kal_konv
int 21h
lea bx, buffer+2
compare :
cmp byte ptr [bx],0dh
je exit
cmp byte ptr [bx],20h
je space
cmp byte ptr [bx],5Ch
jae f_kecil
cmp byte ptr [bx],5Bh
jbe f_besar
inc bx
loop compare
f_kecil :
mov ah,2
mov dl,[bx]
sub dl,20h
int 21h
inc bx
loop compare
f_besar :
mov ah,2
mov dl,[bx]
add dl,20h
int 21h
inc bx
loop compare
space :
mov dl,[bx]
mov ah,2
int 21h
inc bx
loop compare
exit :
int 20h
end start
Assembly (Program Konversi String (UpperCase&LowerCase)
By Martin Blog
Category:
0
komentar
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar