TOPSHIRIQ№4
1).Berilgan funksiyani hisoblash dasturini tuzing va KR580 emulyatoriga
tuzilgan dasturni kiritib, natijani hisobotga kiriting.
Misol:
Berilgan:
10 ta elementning summasini hisoblang. Elementning birinchisi 0х1000
adresida joylashgan. Olingan natija 0х2000 adresida saqlansin.
𝑭 = ∑ 𝒂
𝒊
𝟗
𝒊=𝟎
− ?
F=0x2000
Dastur kodi:
The
address
(hex)
Label
Mnemonics
The
code
Content
MVI C, 10h
Move 10h to C
LXI D, 0x1000
Load value 0x1000 into DE
loop:
LDAX D
Loading the DE value into A
ADD B
Adding B to A
MOV B, A
Moving A to B
INX D
Increment DE
DCR C
Decrement C
JNZ loop
Checking the Z flag,
Z=0, then go to the label loop
Z=1, then next.com
STA 0x2000
Saving the result to cell
0x2000
HLT
End of program
1)
Yuqoridagi bajarilgan dastur asosida ixtiyoriy ikkita sonlarni ko’paytirish
va bo’lishni assembler dastur kodi yordamida ishlab, K580 emulyatorida
natijani chiqaring
Do'stlaringiz bilan baham: |