Mikroprotsessorlar va mikroehm asoslari


bitta k ristalli m ikrokontrolleri uchun



Yüklə 9,57 Mb.
Pdf görüntüsü
səhifə116/222
tarix13.12.2023
ölçüsü9,57 Mb.
#140443
1   ...   112   113   114   115   116   117   118   119   ...   222
Oljayev.

4.10.3. 1816 bitta k ristalli m ikrokontrolleri uchun
program m alarga m isollar.
Q uyida k o ’rib chiqilgan turli hisoblash protsedurasi programma ishlatilishi 
misoli mos nomlari bilan berilgan qism programmasi k o ’rinishida tashkil qilinadi. 
Misollarda, agar alohida shart q o ’yilmagan b o ’lsa, R0 va RI registrlari vositali adres 
registrlari sifatida ishiatiladi, R2 registri akku mulyato r kengaytiruvchisi funksiyasini 
bajaradi (2 baytli s o ’zlar ustidagi operatsiyalarda), R3 registri esa rogramnia sikllari
149


hisobchisi b o ’ladi. Ikki baytli sonlar ustidagi operatsiy a la rda vositali adres registri 
sonning katta baytini k o ’rsatadi. A kkum uly ator operandlar va natijalarni vaqtincha 
yozib q o ’yadig an jo y l a rd a n birining manbasi sifatida ishlatiladi.
4.8-jadval
D 1 V U 0 :
P R O C
- b o ’ l u v c h i n o l g a t e n g m i ?
C M P
B X . O
J N Z
D V R O K
- h a , b o ' l i s h n i i n k o r q i l i s h
I N I
0
- jo r i y q i y m a t n i s a q l a s h
D V R O K . :
P U S H
ES
- E S s t e k d a s a q l a s h
P U S H
D1
- D I ni s t e k d a s a q l a s h
P U S H
C X
- S X ni s t e k d a s a q l a s h
M O V
D I, 0
- 0 t o ' x t a t i s h v e k t o r i n i t a n l a s h
M O V
E S . DI
P U S H
K S |D ! 1
- v e k t o r n i s t e k d a s a q l a s h
P U S H
! S | D ! ‘ 21
L E A
C X . O V R - I N T
- I N T O v e k t o r i O V R - I N T b e l g i s i g a
M O V
E S : [ D I ] , C X
M O V
C X , S E G O V R - I N T
M O V
! S | D I • ?.|. C X
D I V
B X
- t o ' l i b k e t i s h b o ' l m a g a n d a .
SU B
B X . B X
- B X = 0
r e s t o r e
:
P O P
E S : [ D I + 2 ]
- I N T O v e k t o r i n i t i k l a s h
P O P
E S : | D I |
P O P
C X
- r e g i s t r n i q i y m a t i n i t i k l a s h
P O P
DI
P O P
ES
R E T
- q a v l i s h
- U s h b u t o ' x t a t i s h d a s t u r f r a a m e n t i t o ' l i b k e l g a n d a b a j a r i l a d i
O V R - I N I :
P O P
C X
- S U B B X . B X b u y r u g ' i g a o ' t i s h u c h u n
q a y t i s h a d r e s i n i i n o d i f i k a t s i y a l a s h
L E A
C X . R E S T O R E
P U S H
S X
P U S H
A X
- A X q i y m a t i n i s t e k d a s a q l a s h
M O V
A X D X
- b o ' l i n u v c h i n i k a t t a s o ' z i n i v u k l a s h
S U B
D X . D X
D I V
B X
- A X g a n a t i j a n i k a t l a s o ' z i n i . D X ga 
o r a l i q q o l d i q n i y u k l a s h
P O P
C X
- A X ni S X d a t a n l a s h
P U S H
A X
- n a t i j a n i n g k a t l a s o ' z i n i s a q l a s h
M O V
A X . C X
- b o l i m i v c h i n i n g k i c h i k s o ’z i n i s a q l a s h
D I V
B X
- n a t i j a n i n g k i c h i k s o ' z i B X d a. q o l d i g ' i
D X d a
P O P
B X
- N iis us iv B X : A X d a
I R E T
- t o ' x t a l i s h d a n Q a y t a r i s h
1)1 VUO
E H D P
150


ADD2B:

Yüklə 9,57 Mb.

Dostları ilə paylaş:
1   ...   112   113   114   115   116   117   118   119   ...   222




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin