;/===================================\;
; Program Untuk MEMANGGIL STRING DAN ANGKA;
; dan ARITMATIKA
;/===================================\;
MODEL SMALL
.CODE
ORG 100h
start :
jmp proses
a DW 10
b DW 20
c DW 5
d DW 5
Kal1 DB 'Bil A = $'
Kal2 DB 13,10,'Bil B = $'
Kal3 DB 13,10,'Bil C = $'
Kal4 DB 13,10,'Penjumlahan A+B = $'
Kal5 DB 13,10,'Pengurangan B-C = $'
Kal6 DB 13,10,'Perkalian A*C = $'
Kal7 DB 13,10,'Pembagian A/C = $'
ent DB 13,10,'$'
proses:
mov AH,09
mov DX,OFFSET Kal1
int 21h
mov AX, a
jmp tampil
out1 :
mov AH,09h
mov DX,OFFSET Kal2
int 21h
mov AX, b
jmp tampil
out2 :
mov AH,09h
mov DX,OFFSET Kal3
int 21h
mov AX, c
jmp tampil
out3 :
mov AH,09h
mov DX,OFFSET Kal4
int 21h
mov AX, a
ADD AX, b
jmp tampil
out4 :
mov AH,09h
mov DX,OFFSET Kal5
int 21h
mov AX, b
SUB AX, c
jmp tampil
out5 :
mov AH,09h
mov DX,OFFSET Kal6
int 21h
mov AX, a
MUL c
jmp tampil
tampil :
DEC d
mov BX,10
XOR CX,CX
ulang :
XOR DX,DX
DIV BX
PUSH DX
INC CX
cmp AX,0
JNE ulang
print :
pop DX
ADD DL,'0'
mov AH,02
int 21h
loop print
cmp d,5
JE out1
cmp d,4
JE out2
cmp d,3
JE out3
cmp d,2
JE out4
cmp d,1
JE out5
int 20h
END start
Semoga bermanfaat.....