0 ratings 0% found this document useful (0 votes) 4 views 25 pages Microcontroller
The document appears to be a technical guide on assembly language instructions, specifically for a microcontroller architecture. It covers various addressing modes, arithmetic operations, stack operations, and control flow instructions. Additionally, it includes examples of instructions and their effects on data manipulation and program flow.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save Microcontroller For Later
|
Asstanmevct =o
0 Expioln ues Li ffOurunr add veratug moot wil
cxomopty
_y | Addie flee ae mod $ The varteus jermatu
A Specifying de oprabrd ane valid acddrse
bee i meee
modu
@, Immediaw Ad tug mocks
lu thik ada vontng moot § data ‘epectfi of
ar. fuatruction tes
ax| pata Lo Apedited by “# symbes befere data
JA we tnataucttan
Ena pl +
mov A, # WH 5 AL ISH
| mov DPTR, # DOK 5 OPTR = {000}
GD Pager Adds iirg moot, :, pata tr spectre
be sagiotils Un — uneuction
| ta pumided Oe Qu. Ay RE Pp beetenseM
(HD) Pivece Addresting Mode) pure antaay
opraud 4 aiken Ba Lud RULE ON - 4
* Only Latonot RAM aud SPR ALT o,,
aulewud .
eq: Mov a, 3SH
you 5
3 AK BSH)
ov Ar A = Teo)
GO| Jodie Addl revving Mods In tha Ody,
| mode, addr \. operand Uw! He dhuy
|
| by. agit
¥) tunel & “Exterod RAM Com be oc
| dae mode
| Jtunot. Ram uoth obits Fi antl
| S@o used. hire
Mov A, @Ri sa<—(e1)
Mov @ RA Ss Cespe a
| Inde pd Aolotrentrg Mo ol, :
xe | The addrexatin modt uo U4 £9 .acum
or @xtinrot BOM)
* In ditsurtion ,wr um ‘Cc to peal
with — Tyrdexral deen’: medSoup ¢ =
Move A, @A+DPTR -
opie Cone DuTPal
MOV C°R GUAT tee raaca|
wide = au
gS
: ALP us muti ply 6 (6 bit
numb. wilh 6 pit numbu
ad ore
i OR .0000H
MOV. 40H , t00eH
Mov 4th, Ho0H
Mov 42H) OOH
Mov ASH , HO0H
2 pole hy MBE gt
MOV A, 30H
Mov By. B24 © .
MUL AB
mov HoH, >
Mov aH, B
er '
mov A, SIH
Move , 23H
MUL AB
| Appa, 42H.
EE, co / UB / atedMOV 42H Ag
mov A,B
ADDCA, 43H
Mov vast lA
END
@ > Explain Rota Dttution utth ceompe,
voy Sune ta wt utters
7@ Protas uurteut
Cy} RRA > te wll pujorry qetatt Dike
| uitthe ut ee by 4 nit
| 4 fnittatey A 40H B Caney = 1
| Bf fon Ttsuceton As 28H & Cay co
without cod by dbo .
xo tata 8 46H ens sh
y Pere aL ee
|
|
|
|
|
|i vets 3
io) TAs PAUE In 1 » tet aud oo
y | Rotor ULL ay unatwuctton
fi) RAG A> LH wtul pajorm qian Pigls q
[> aac seg ua cary. by 4 bia -
| aft
, Att As ubH & Cammy’ =4
+ y Luittoiy Te
bs penn tsk ctian < \ ‘
| 4
hae co
F
pian Tmituctton , hd aud 720Bm
ta
a
: : ——
(fw) ee An n itt maga ptay fe a
Ake qwakwucttion , AS BDH aud CAeey 29,
| lo Mae lun pom,” |
a USNS RM ye, Rane acitren ; \ |
Eutt fim 9 Decrment Jump ay Not Zero |
oy] the Aaglason Pr io vtwand by 4. |
ee
prgrom qumpr 79 The Gotlm eae
2 Thy Bs rout ben x10 _ b
conénus de tN not tin attenes reuires $ copes
4) | movx aA, @mpyece perk
Fullforrn 2 Move EXoAnad eae Ae arty,
¥ & Reads ata pom Antnrral RAM, 9¢at,
pointed bey PPTR
¥ Stores hat @ data tute accurmulatey 4.
Excunp : iiaeit
Move a, @ oPTR
byte Teyuized & ee
()} Explain AL iawal Araimaut sastucing
| Uhr > exams
Addition Listucton :
App — Dp uth | Ada Accumulator data |
ett —g biteg of Stores Reth ile
pvc — TU WR Add Aceumutatey tata
. uth 8 biky long Witty Co & Stu pau
= Gia eiCOD P 5 atcr ie Cee .
| ADoG Py te Sor 2 aeAbalion lnrtructhoys +
With Sub ACcuMmuitior data Usith
Gv
suBgZ- I4
¢ bite atang ULL Carry & shove, Kut
Sinko “A
6, eee SveBA, ¥ ON s ohee MRED Tar
‘ Ac oA Rae ae
CORE PR , rks 5
Guptru tons:
tit) Tununet
inuaemeomgt Pratt » PoinBr or
Inc - & ull
Bare. scwcd Jn Coons
6,2
TINcA $A A th
Inc Rt 3 Rt Ratt
Inc ‘25H 3 Dos — bad +4
(6), Decaemeut aes
pec —. tt wit §=diaunwr iin » Potntn or 1
adore of wee bookKon .
pee A hea -“A
ce
pec Pt
Re kyo-t
wo mouuipicatton instructions 2
| Mupae = & wi nr ply, A BR One
wi be steer in PA he
Lak oe >
|
(ie=
MUL AB 2 CButqnen Byb, Powering) = A ig
a) Division kastmchon +
DIV 4B. Tt ull diuide A be B anol Praag
itu be stored unr & gud oe
eng
¢
Kempinkr
win, bw sored
(18 remain Deuottent ) = 4/a
un A
piv Ag
© Explann difrunt Log cat dunce ons
with exaumpus.
7) kage pup Lnseruction:
ANL > Te urtte perform sonic AND WA between
tue & bi numbur
Qs ANL A, # 50H eh oad? AUD SOH
ANL A, Rs SR ee ee
ANC Ai 5 Ren Ape
ae Spa Les)
D
eae 5 afark) [25H] ANDA
PNLOCH SOK ~ 5 Poet] < Last] ANP SH
(0) | tage OF tnnerUeton:
ORL-Tt urbe perform sogie OR fn bwo Tue
g bite » numbeu
pom OO Aaa Ue. fA EOC
OkL 25H, A — ; alara'\< [95H] of A
ORE a OR, 2 eet ores)TOR wit chon, Si
He wall 82 peyorm Aege KOR tr belivern
Ww § bike number
& XRL A, #50H 5 REA: xoR StH
XRLA, ITH 5h eA xon CH)
REN DSH 18h 90H .. 5 Coo] 2 Toan] koe ke
294 al
struc ons ;
eyerm 14 “ompument ay
meat NOT epration a A
Che ka — It
Cee aA alt uit Clear Accumulator . s A001
apes Lacauchion
cusar A Te Wil rep swap four Mibbe oxy
higher nibbu Of A. means 4 A = teH afte
Auctouction A= 8H
GRR ut go noNtng eee
easly OE a on oa ae
r
cries peg i eo
aie anil
Gi) stack Sursruulon(|) Stack Opexation G
Stack fy .a ALmpo TORY Aho a) @ aug
pat uorbr’ on Se. prince py 4
diz munory
4 tu> Feyst Out)
LL FO (kaot
%|| PUSH Opecate ™M: :
. | upd te Bore data JUN. Shs Uack
Dl yma sta point (2p) nove eget
POSHA. > mean renintn A ta stored In Cate
*) Pest POP opealion <
| wid to qmove data “fom AM stack
Pata fom te. Lop of Xtack dy tabonrow-
pop B > Pata from stack th copteal tnle ram B.
t b
(i) | Atak wnstrution:
o| PUSH Iuetruction :
| Gorn giotn pa data sunte tack
PUSH B > puch. BC par
PUSS OR push pe pais
push H—> “push He pout
pute PohL > pushin Becurmumalor + Pog req lot
o| pop: tnatructons
poriwn daka_eom Atak
pop &
| por D
] Por
| pop Psw
a aQ | Expatn braucy, Lucca ee
WM Ong asta ccae aia
en) Brant Buc 2 ie
MAS tructon,y an weg
norma ag ay oe
£eq
RIN Fens rare execution
(0), WWenditonal Sump Lnstructtons «
sTMp Laber- Ut frp 28 Aecation usin reper
49 taku € febitey
ASMP kedbc— Be afltrrcp: 0 tection ott espeet
tod abu
Raina of SIMP La = Rf to +14 Localton,
(eral Roden, with be PC = PC + Label
pitap ealaee Dt yung, ge fearon Es
ts tobe Ke bitsy
Romge . @, ATMP ub &k6 ; 5
. = 4st Shia & PC +3bu
cinar Addr uke be Pe = 4 ‘
of ATMP + date
Lamp dab - if Gump 78 Tele +
Te fre Oar ee
of 8051
Fina. Add
abet 165a
o
un wilt be PC = dabee
tr wile jump wo te oa
P| 2 eTR
| TMP@A+D 4DPTR(2) Boo Lean Condition al Jump Loar A
Ons,
fan ou stmMpy
E TB Pog, Lobel > Tump te hah ou ae
-| DB Ppo-0, dabek - Jump Ao dabet One 2 pane
20
FBC PO-0,dabel _ Jump 29 dobet ee 4 Poo my
avd also make Po.0 0
con atone — Tuy tat ors 4 Au me Sry
DINZ 2s, dobt - It wihu-F ol cee Re, awd
ump 20 he tabu only 4 Rt net ry,
«| PINL 95H , dab - Tt with chemment [25H] aug.
dump 29 ts jab only ABH) Be not
700
Co ME BD; H2SH pdabe — Lt ust compare A lth
A
plas ound qurnp XP ths abel only
Pe aR Oe eyo
m uuku ‘vompare (er)
cre OF: # ASH Agbee ~— Tr
Le ee ae
| Ro Oud asH axe net equal
4Nc label’ Lt wel jump Aw haber +4 wus hy
preview LAAT Oo” Coney pag his@ |p CS bie Manthularcea itn ie —
KOMA
: oe Manipulation meaw: 9
Andividuol bits (0 or 4) tnand fon i
i Of fue bpleo
wed for
LED Corte
+| Cutt Checks
2| Senor ig muy big
© Fag operations
¢| Port umtrol
y| Lt t% Lmportaut becavue ;
sexppoue ,.one LED umneteal fo P10
You Want te on ff scat LED
Drateot of chouging alt & bite of Port 4, ue Can
cortsol only One’ bit
Bos aloury bit operations ons
+ oats CPo «Pa, Pr, Ps)
| pst
| eet as vocations
(| sete Coer Bit), 2. Und 9 make BNbiit vatee 24 ali
£95 set& P4.0
(A) Le Cuan Bir) > weds, cheany a bat oy rate BF
| vol O
&4? OLR P 4-0.
Gm) pL coo pum ent ger) Cre ln etructton Lo WH
I Ie egg! or vom piem ate The bit valu.
674 2 t pt.
| Ae ae(My)
(w)
vi)
(ti)
Mov c , bft 8 eae -
oa it tw pe i
0 Ae the ate fg. Yat,
&9: Mov c, pei.o a
Mov brt»C> thh tutuctim copten wy, a.
29 youu Uule a spect fied bP: 7
éq: Mov PL.4C
ANE GbE > Pesforma Logtbas AMD Opealen,
enween Sea a9 aud a peck fed bPt
ég: ANL Cc, P10 :
ORL C, LIF > Performs hogteal OR Op eation
bemernn Cary ag Ouch spectayidt bir.
&45 ORL C,PAv0
TB Gump i Bit Lb) » 3B Unctuetion Maudpars
program umisol to a Mperifies 42bU if Ha
be ave
ys TB PLo , LABEL
gue. Crump fy Bd Mot Su) — “tran peeo Lonlaal
A thy Spitifed bu tao
qs “NB P40, LABEL
ypc C gump 4 Bat Lt aud clear) 3 yumpre
Rpmenoa Hi He wi eb RET ed
ears ahot bit
| en; TBC P4-0 | LABEL.FO) Spiadin cata trassper Luctuetions [Link]
Ai) Move Uuattauctlons $
eve Tectia sma vd .olata uae
Amarion %9 awnothn Location
Gi MOV» #oDH 3 Ae SDH
Moa, @ei 4 wetes}
(1) Stack Guctructons:
PUH - Tt usb etoxe data on, stack
ein PUSH, 4st SP uit fh Aemet by 4,
& ullu store data on dak.
Hau
pop- it usu 6 Le0d vata pam stack
Sn pop, 1st Load data fom stack tun ff ube
darumurt SP by £
jy Pom RS py ull be stored On tack
5 (95H) wilt bt Ltered .on. ctack
pusd 95H
pop RL ¢ pe viv be Looded fom tack
pop arn sPast) witt br leaded’ om Stade
(i) Ex chanrye Brdrsi cdo s
. wen 7 Ub uu eudnaunge ‘Wns mention Que
Late
PexcH A, Po. 3a <7 Ro
me se A)—4|
la cetlonn ae “@ty eo it wil LA Oge AD ULUy
Nibbis of the mention! t4u9 otata
XCHD p, @PL 3 Ae Ce} only Lou, Mibgy, ;
@| pute on Arp te exthang, 8 block 9 ony
a
Wing 9054 :
ORt OOO00H
MOV Ro, #30H *
| Mov Ri, #40H
| Mov Ri, BOAH
| BACK: MovA,@Ro
| Mov Rs pay . |
Mw A, @ Rts
Mov @ Ro, A
Mov ,R3 ;
mov @R1,-4 .
TNC Ro
Ine Rs
i
DINZ Ra , BACE
HERE 3 SIMP HERE \
ENDth
She
write an mp te tua
huumbe,
open
MoVaA , 30H
MOVB,A
=> 0000H
MULABS )
Mov 32H, A
Mov 33H 8B
| MOVA 32H
mMovB , 30H
mut 98
mov 24H)A
| mov 35H
| ENP
é ip 79
©. Wate WA ALP
8051
=| oe, 00004
| mov A, 30H
| nea Anon 374
| mov, 24HA
| mov Ay 3lH
| appc A) 33H
| mov 3st, A
|
| Find
5 Find cube
84 Woke And Crbe a, 8 bit
square
dl ieee$300 Ce Aide
Apne A
mov 36H 7A
END. 4
cepa SLA Tus 16 Bit No
(i Oo briny i
ORm O000H
cCEee
mov A) 30H
SUBBA , 32H
Oe A
“Mov A, 3uH
- ¢uBBA, 33HSmattear
K/ep bf 0.
OR& oo00H
MoV Ro # NUMBERS
Mov A, @ Ro
MoV X A, @ po
NUMBERS:
DB 10, S, 6/3,19)20
END
| hte an A
Cp te a an obit numbe,
a L é
a @ Reece aud ee ord
ASeunding ordis
ORW 0000H
mov R+,#04H
MALN:
Mov Ro, #30H
Mov Ro, #04H
uP*
mov A, @Ro
INC Ro
Mov &, @ Re
CIN € A, B, NEXT
NeXT :