0
59kviews
Explain 8051 assembler directives.

Mumbai University > Electronics and Telecommunication Engineering > Sem 5 > Microcontroller and Applications

Marks: 5M

Year: May 2015

1 Answer
4
5.1kviews

Assembler directives

ORG (origin):-

The origin (ORG) directive is used to indicate the beginning of the addresses the number that comes after ORG can be either in hex or in decimal if the number is not followed by H it is decimal and the assembler will convert it to hex some assembler use “.ORG” instead of “ORG” for the origin directive.

Ex:- ORG 0000H

EQU (equate):-

This is used to define a constant without accupying a memory location. The EQU directive does not set aside storage for a data item but associates a constant value with a data label so that when the label appears in the program it constant value will be substituted for the label use EQU for the counter constant and then the constant is used to load the R3 register.

Ex:-

COUNT EQU 25

MOV R3, # COUNT

END:-

Important pseudo code is the END directive this indicates to the assembler at the end of the source (asm) file the END directive is the last line of an 8051 program meaning that in the source code anything after the END directive is ignored by the assembler.

DB (Define byte):-

The DB directive is the most widely used data directive in the assembler it is used to define the 8-bit data when DB is used to define data, the numbers can be in decimal binary, hex or ASCII format for decimal “D” after the decimal number, for binary ‘B’ and hexadecimal ‘H’ required. DB directive is the only directive that can be used to define ASCII strings larger than the character therefore it should be used for all ASCII data definitions.

Ex: -

ORG 5000 H

DATA 1: DB 28 (Decimal)

DATA 2: DB 39H (HEX)

DATA 3: 0101001 B (Binary)

Please log in to add an answer.