Вы находитесь на странице: 1из 8

Brunch Coll ①

chops :
,
and the

Stoehr

Infinite loop -

JMP :
Jump : 4 bytes : 2 others in thrum

Rjr P rehtive 2 bytes doubters in thrum


jump
: : :

⇐ execute it
,
is i3 forever
,

sold

Lp
I
loop : i
,

is

loop ( or Rzmp loop )

BRNEBRNE
:
Brunch
if net equal
lost result iswtegul
⇒ Gota label if
to Zone

LDIRH ,
o

⇐ LDI Rib o
,
LDI Rtt 3
L DI Rit ,
3
,

ADD Rib Rtt


⇐ L DI RIO ,
6 ;
Rg
,

ADD Rib ,
RH loop :[ ADD Rib
,
RH

ADD Rtb ,
RIF DEC RIO
ADD Rib , RH BRNE loop
ADD RIB , RH =

ADD RIG RH
,

wht the nb Ens Gn loop
CD is .

of we
repent o .

soy In lost example R2 o


-

- 6

8375
O 000 0000 -
3 I l I l I I I I

o → 255

Loop inside
-
loop
to load Pu RTB by oxss
ED write a
program
Ems
then hrpbnrt it too

on 't do u
sigh
soy 7255
-
we
700 ,
=

too =
70 x to loop
Iss Tess
£20 KEI

Rtb ox 55
LD I ,

out PORTA ,
RI 6
L

L DI Rao 70
,

÷: i
R 21 10

÷÷÷÷'
→ L2 :
LD I ,

Ll COM RI 6
'

on :*:
.

"

Ey repent
lust eionpk but hrpbmtloooooks
sold 100000
) 255
Ess
ness Less
100 ooo
'

- 100 X too x to

RIO R2 I R -22

L DI RIG ,
01155

out Porth RIG


,

L DI 100

RIO
,

23 :
LDI R2 I
,
100

L2 : LD I R 22
,
10

Ll .

.
Com RIG

÷÷:÷ :
DEC R 21

BRNE L2

DEC R 20

BRNE 23
16kt =L Bytes
-

BRNE : 1111 other hrhrkhr Kool
S
-
f h 3 2 I 0

.
ORG OX 00

0×00 LDI RIB 10


,

3×03
ox ol LBJ RIO ,
O

0×02 LDI R2 ) ,

L : ADD R2o , RLI

0×04 DEC R 16

1001
oxo 's BRNE L

0×06 OUT PORTB RLO


,

PC new = Roll the

0×03 =
0×06 the ⇒ hr =3 -
6=-3

3 or 7 bit i 000 0011

1st Corp : I I I I 100

3 :
25 top : 11 I 1101

KG II. Thr
- . .

1111 ol I I I 110

BRNE L 1111 0111 1110 1001


ox F 7 E 9

lool ol K2 K2 110416
jmp o
hrighhohyz
-
: ,

hhskqtiyhk hi ,
h¥h¥
hiokghrg hrs kg high'd " h"

hr = Pc new
= where to Go

-
ORG OX 300

]
0×300
Loop
!
LDI Rho ,
0

0×301 com R2 0

0×302 yup loop


ox 304

hr2ih2u to

hr = O X 300 -

-
00 000 O OO 0011 000.0
00 0000

01

1100
I 001 O O O 000

0000 00 I I O O O O O 000

jmp Loop : o x S 4 0 C

o X O 3 o o

RJMP 1100
hruhhokgkphrtkokshrqkshrzk.to
-

Pcnew : Pc old th
-

R G Pc new 0×300

300
=
- o o X

0×300
loop :
Lpg Rho o Pc old = 0×303
,

0×301 R 04300 0×303 the


COM 20 =

hrs
0×302
Rynp loop =3 3
-

0×303

Let write 3 on 12 bit :
oooo oooo 0011

1st hop
'

.
l I I I I I I I I I 00

'

111-1
2 111 I 1101
⇒ 3 =
legs :
-

try hi , Ko

It 00 Wh -
- - - Ko

It I I I I I I I I I
=) ou I
of

⇒ Rjmp loop : OA CF F D

CALL and the stack


-

CALL is used to all subroutines ( fmctg


in osvnbly ) .

when we all a subrata we must know

ite return bowlers

CALL : lool 010421 Kaki , high


'
it 111 try

HIS ' "

hill Ki ,
.
. -

tip try . .
-

kg kg
.
-

No

hr :
Pc new

The return others will be stored is

RAM Collet the stack


o -

port of the
8 bit obit ⑦
SP : stack pork : 16 bit sPH
↳ where we one in the steak

Jmp
CALL →
↳ push store tee meet others often
CALL in the stuck
and olehut s p

subroutine must end


Eng by RETURN

RETURN → Pop : in cut sp item


ret ite hotels of the

stock → Pc

ed LEE 's wit o -

prgrm to cont
from
0×00 hi o x FF 0h01 send the court

to port B

use loll for sending


out to Ponty
outta hell debug
and Ii
fur a some

. ORG o X 00

0×00 L DE RIG ,
HIGH ( RAM END )
0×01

ftp.go.wcrn-nems/Qee
OUT SPH ,
RIG
o X 02

oxus IF
0×04
LDI R 20 ,
O

SP
0×05 book : call display →

't
oxo
RJMP bar

ox of display : INC R 20
I esp
t
0×09 out PORTB , Redo

0110A CALL oblong →


C
oxo
RET -
s
.
ORG OX 300 p
0×300
obly !
LDE RIG OXFF

¥
,
0×301 No p
again
! o .

:3
is Fi!
" . "
us
. .
0×304
B RNE again
0×305
,
0×306 RET