50% found this document useful (2 votes)
6K views8 pages

Directives of 8051

The document discusses several assembler directives used in assembly language programming including ORG, DB, EQU, END, CODE, and DATA. ORG defines the starting location of a program in memory. DB defines bytes of data in various formats. EQU defines constants that are substituted throughout the code. END indicates the end of the program. CODE assigns a code memory address to a symbol. DATA assigns an internal data RAM address to a symbol.

Uploaded by

Piyush chaudhari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
6K views8 pages

Directives of 8051

The document discusses several assembler directives used in assembly language programming including ORG, DB, EQU, END, CODE, and DATA. ORG defines the starting location of a program in memory. DB defines bytes of data in various formats. EQU defines constants that are substituted throughout the code. END indicates the end of the program. CODE assigns a code memory address to a symbol. DATA assigns an internal data RAM address to a symbol.

Uploaded by

Piyush chaudhari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 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