MC Yashwant Missed Week
MC Yashwant Missed Week
pijdalina.
pipeline fetch1Excu 1feh 2 E 2
pieelinarh
feth 2 E 2
fteh3 [8e 3
T/ T T T T
Tdepends (yde cycle to eneute instruc"
Gn osilla ? neyde to feteh next
ohen no ipeline
Crystal
T=. DelayCalulathion for ArR
q find size of dlay ,if wstal freq is lo MMz
T
instru?
-DEF cOUNT =R20
yde
DELAY: LDI coUNT, Ox fF
1
AGAIN : NOP
Nop
tOfDEC coUNT: cydu to chut
BRNE AGAIN 2/4 if count is zew
RET ofee y cde to
2retusun
4 to AGAIN.
OR
HERE locp
AGAIN loop
= Q498 ys. (RI6).
(250 epecuting
CALL DELAY.
RgMP Li.
coite hu dutu clute
(trunsfe t pin).
DDRX-n
trom cpUto
pin n of PoRTX-n
HPIN*n
oukid insiele ’ead ke clat.
celle cduta fno m pins
to coU.
DDRx =0 PDRx =i.
pORT
f
poRT
HPIN HPIN
Gnly read datu. ik He data. 2
tunsf to PIN to recolit,
FF
LDI RI6, ox
OUT PDRB, RI6
IN RI6, PING
LDI R I7, 5
RI6, R17
ADD RÊMP L1.
OUT PORTB, RI6
MC minor
prog rum Huh memora Boot progru sectien
Botk o App lic atien proyum setion.
Stack ’ when one fxnt calls fen 2, ohile rtwening fom the call ,stack
Stores the addoess af fn (storiog etn adloress)
alocatd from 8RAM) Space
rhepto- pointee : acd es of mem ony loccation
Addus
pointo ’k e megis es l6 bit memorg
fEPRom’ ohen erbed, l . bis ce set to fFr.
o3
R22
R3I ox2
SBI poRT D, 0
L65 49 2 o
S8I DDRC, 5 ,b b i t no.
SBI
|(001010 qaad abbb 6* bit of Jocatien aas I
setting
for SBI s bit
sign
negatire positiie.
p. add 3cE7 and 388D, location - R30 R’E7
Stoe tsult in
Camy
RoL fla
otuBe left,
SEC
;set curr flaq > (=1 .
DI R20,0x15 ; R20 = o0ol ol0| c .
msB RoL R20, RR0 ooIo10)|C=D
RoL R20 R20 = Ol0|0|o c
LS8-C signed
Dumbe. 23tomplimunt
0XDO:R20 I|0| 0000 (-48),C=O.
LDI R20,
1000(-24)) C0.
ASR R20 R20 =||0 oj00 (-12), C0.
| Joo -6), C -0
AsR R20 R20
ASR (-3)
ASR (-2)
ASR ()
Assum e hut R20 hab the ho. - 6,
shoob that SR can't be
6
Used to diide he content of e20 by 2
LDI R20, oxFA
LsR R20
450
IR5.
tre
wmbe
Q. . shou how we CCun ude RoR to diide by 8
CLC
LDI R20, OX 3o 48= 00 16| 0000
ROR R20 ; RR0 = oo01 1000,CEo
Rao = 3
S(24)
ROR K20 ; R000o0 oo (i2, C 0
CLC
C0.
KOR R20 RR0= 000o ouo(6),
SOAP
Rd.
Before, |D, - D4 JD,-Do