Assembly Directives in 8051 Microcontroller-1
Assembly Directives in 8051 Microcontroller-1
Assembly Directives in 8051 Microcontroller-1
£Ci/V£S
-
I
ORC. :- oR;C.;...,lc -, dil,-,1. -ii., sJe,'-'i o ~ -IClf '1k 'P"'3 · /11 tp«IJ· ,_,,.,,.., ·
OJIG. Oi H ·) ,Siaf/f"' o,JrJ.,ub 11 0 001 tf
0~~ 12.3~H--> $4o14'·. ,. ~ ,-.,, /'2.3Y'1
-- - .J
Assembler directives:
•ORG
•END
•EQU
•DB
ORG (origin)
END
• This indicates to the assembler the end of the source (asm) file
• The END directive is the last line of an 8051 program
• Mean that in the code anything after the END directive is ignored by the
assembler
EQU (equate)
COUNT EQU 25
........
MOV R3, #COUNT
DB dlredives
ORGSOOH
0828 ;DECIMAL (lC in Hex)
08 001101018 ;BINARY (35 in Hex)
DB39H ;HEX
Assembly - - . . w·
Assembler
Language Program r---. -..~ Machine Code
208
210 ISHAN'S Programmable Logic Controllers and M·
ICroeo
l'ltro11
9 .2 ASSEMB-LER OPERATIONS er1
~ Editor
Program
filename.asm
~
~ -
· Assembler
Program 1filename.1st
filename.obj
other obj flies
• ♦
Linker
P.rogram
filename.abs
'•
Object to Hex
Progra!"
filename.hex
ROM Sumer/Loader
~ d Directive
. Syntax : END
(.END for some assemblers)
· The END directive tells the assembler to stop assembling. The END directive
should be the last.line of the-8051 program as any line written after END directive is
ignored by the assembler.
9.4 NUMBERS
In assembly language programming, a :nwnber must start with a number from 0
to 9. If the number is in decimal, nothing is required to be post fixed with number.
But if the number is in hexaqecimal i,ystem, then 'H' should be post fixed with the
number. If a hex:a~d~ci:rp.al numb~:r !=!tart with digit from A to F, then a 0 (Zero) is
prefixed wit~ the num,µer otherwise the assembler will treat the number as label
and will give error. ··
Example
693
4168H
3AH
0BC3DH
9.5 SYMBOLS
.Normally assembl~rs inclu~es sy~bols for special function registers and for bits
Jf bit-addressabl e special function registers. This helps the programmer to write the