You are on page 1of 8

Assembler Directives

Assembler Directives
1. ORG
2. DB
3. EQU
4. END
5. CODE
6. DATA
ORG: Originate
• This directive is used to define location in
program memory where the program is to be
begin.
• For Example,
ORG 100H
……..
……..
The program execution begins from program memory
location 100H.
DB: Define Byte
• This directive is used to define 8 bit data
where numbers or data can be in decimal,
binary, hex or ASCII format.
• For binary, “B” and for hexadecimal, “H” is
used. For decimal, “D” is optional.
• For ASCII, simply place the characters in
quotation mark like “MSBTE”
• For Example,
NUM DB 28
INT DB 34H
STR DB “ABCD”
EQU: Equate
• This directive is used to define a constant to
which memory location is not allocated by
the assembler.
• Means the constant value will be substituted
for the lable.
• Mostly the EQU is used at the beginning of
the program.
• For Example,
PORT_ADD EQU 40H
END
• This directive is used to indicate the end of
program.
• When assembler encounters END, the
assembler will stop converting assembly
program into machine code.
• For Example,
………..
………..
END
CODE
• Using CODE directive, an address in code
memory is assigned as a symbol.
• As a maximum size of code memory is 64K,
the address should be within the range 0 to
65535.
• For example,
START CODE OOH ; Memory location 00H is called START
DATA
• Using CODE directive, an address within
internal data RAM is assigned to a symbol
and address must be in the range from 0 to
255.
• Hence, any register can be changed or
assigned with new name.
• For example,
TEMP DATA 32H ; Register at 32H is named as TEMP
STAR DATA D0H ; Register at D0H ( PSW) is named as STAR

You might also like