SlideShare a Scribd company logo
Designed by Manoj D. Harsule
Lecturer in Electronics &
Communication Dept.
G.H. Raisoni Polytechnic,
Amravati, Maharashtra, India
Microcontroller Basics Directives
System tools
Editor
Construct ALP
Type using Editor
Called as source program
Extension .asm
Assembler
ALP to machine code
Extension .obj or .lst
Linker
Combines more than one
Converts to single
executable
Simulator
Run 8051 program without
using 8051 kit
If not needed use Hex
Converter
Extension must be .hex
Data Types
 Sbit- special function reg.
 Address- 80 H to FF H
 Bit:- addressable RAM
 00 H to 7FH
Byte data type
Addressable byte by byte
No 16 bit word
Directives are commands of
assembly language itself and
have no influence on the
operation of the microcontroller
8051 DIRECTIVES
EQU directive
 The EQU directive is used to replace a number
by a symbol.
 Syntax: Name EQU Constant
 For example:
 MAXIMUM EQU 99 After using this directive,
every appearance of the label “MAXIMUM” in the
program will be interpreted by the assembler as
the number 99 (MAXIMUM = 99). Symbols may
be defined this way only once in the program. The
EQU directive is mostly used at the beginning of
the program therefore.
SET directive
 The SET directive is also used to
replace a number by a symbol. The
significant difference compared to the
EQU directive is that the SET directive
can be used an unlimited number of
times:
 SPEED SET 45SPEED SET 46SPEED
SET 57
BIT directive
 The BIT directive is used to replace a bit address
by a symbol. The bit address must be in the
range of 0 to 255 (00 H to FF H).
 Syntax: Name BIT 8051 bit
 For example:
 TRANSMIT BIT PSW.7; Transmit bit (the seventh
bit in PSW register); is assigned the name
“TRANSMIT”OUTPUT BIT 6 ;Bit at address 06 is
assigned the name “OUTPUT”RELAY BIT 81 ;Bit
at address 81 (Port 0)is assigned the name
;”RELAY”
CODE directive
 The CODE directive is used to assign a
symbol to a program memory address.
Since the maximum capacity of program
memory is 64K, the address must be in
the range of 0 to 65535(0000 H to FFFF
H).
 Syntax: Name CODE code address
 For example:
 RESET CODE 0 ;Memory location 00h
called “RESET”TABLE CODE 1024
DATA directive
 The DATA directive is used to assign a symbol to
an address within internal RAM and SFR. The
address must be in the range of 0 to 255 (00 H to
FF H). It is possible to change or assign a new
name to any register.
 Syntax: Name DATA data address
 For example:
 TEMP12 DATA 32 ;Register at address 32 is
named ;as “TEMP12”STATUS_R DATA D0h
;PSW register is assigned the name
;”STATUS_R”
IDATA directive
 The IDATA directive is used to change or
assign a new name to an indirectly addressed
register. It is an address of entire internal
RAM.
 Syntax: Name IDATA idata address
 For example:
 TEMP22 IDATA 32 ;Register whose address
is in register ;at address 32 is named as
“TEMP22”TEMP33 IDATA T_ADR ;Register
whose address is in ;register T_ADR is
named as “TEMP33”
XDATA directive
 The XDATA directive is used to assign a
name to registers within external
(additional) RAM memory. The
addresses of these registers cannot be
larger than 65535 (0000 h to FFFF H).
 Syntax: Name XDATA xdata address
 For example:
 TABLE_1 XDATA 2048 ;Register stored
in external; memory at address 2048 is
named; as “TABLE_1”
ORG directive : Origin
 The ORG directive is used to specify a
location in program memory where the
program following directive is to be placed.
 Syntax: ORG address
 Address can be given in either in hex or
decimal.
 For example:
 BEGINNING ORG 100 ... ...ORG
1000hTABLE ... ...This program starts
at location 100. The table containing data is to
be stored at location 1024 (1000h).
USING directive
 The USING directive is used to define which
register bank (registers R0-R7) is to be used in
the program.
 Syntax: USING Bank no.
 USING 0 ;Bank 0 is used (registers R0-R7 at
RAM-addresses 0-7)USING 1 ;Bank 1 is used
(registers R0-R7 at RAM-addresses 8-15)USING
2 ,Bank 2 is used (registers R0-R7 at RAM-
addresses 16-23)USING 3 ;Bank 3 is used
(registers R0-R7 at RAM-addresses 24-31)
END directive : End of
program
 The END directive is used at the end of
every program. The assembler will stop
compiling once the program encounters
this directive.
 Syntax: END
 For example:
 END ;End of program
DB directive
 The DB directive is used for writing specified
value into program memory. If several
values are specified, then they are
separated by a comma. If ASCII array is
specified, it should be enclosed within single
quotation marks.
 For example:CSEG DB 22,33,’Alarm’,44 If
this directive is preceeded by a lable, then
the label will point to the first element of the
array. It is the number 22 in this example.
Ad

More Related Content

What's hot (20)

3.programmable interrupt controller 8259
3.programmable interrupt controller 82593.programmable interrupt controller 8259
3.programmable interrupt controller 8259
MdFazleRabbi18
 
An application of 8085 register interfacing with LED
An application  of 8085 register interfacing with LEDAn application  of 8085 register interfacing with LED
An application of 8085 register interfacing with LED
Taha Malampatti
 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
Poojith Chowdhary
 
Programmable peripheral interface 8255
Programmable peripheral interface 8255Programmable peripheral interface 8255
Programmable peripheral interface 8255
Marajulislam3
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
karthiga selvaraju
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
KanchanPatil34
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
Dr.YNM
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
Ankur Mahajan
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
anil_gaur
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
Srikrishna Thota
 
8255
82558255
8255
INTERNATIONAL SCHOOL OF TECHNOLOGY & SCIENCES (FOR WOMEN)
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
ShivamSood22
 
Interfacing 8255
Interfacing 8255Interfacing 8255
Interfacing 8255
Anuja Bhakuni
 
Chapter 7 memory & i/o
Chapter 7  memory & i/oChapter 7  memory & i/o
Chapter 7 memory & i/o
SHREEHARI WADAWADAGI
 
Lecture #3 Flag Register.pptx
Lecture #3 Flag Register.pptxLecture #3 Flag Register.pptx
Lecture #3 Flag Register.pptx
ImranBhatti58
 
Interfacing of io device to 8085
Interfacing of io device to 8085Interfacing of io device to 8085
Interfacing of io device to 8085
Nitin Ahire
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051
ssuser3a47cb
 
8086 modes
8086 modes8086 modes
8086 modes
PDFSHARE
 
Introduction to Interrupts of 8085 microprocessor
Introduction to Interrupts of 8085 microprocessorIntroduction to Interrupts of 8085 microprocessor
Introduction to Interrupts of 8085 microprocessor
RAKESHCHOUDHARY164857
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
Amit Kumer Podder
 
3.programmable interrupt controller 8259
3.programmable interrupt controller 82593.programmable interrupt controller 8259
3.programmable interrupt controller 8259
MdFazleRabbi18
 
An application of 8085 register interfacing with LED
An application  of 8085 register interfacing with LEDAn application  of 8085 register interfacing with LED
An application of 8085 register interfacing with LED
Taha Malampatti
 
Programmable peripheral interface 8255
Programmable peripheral interface 8255Programmable peripheral interface 8255
Programmable peripheral interface 8255
Marajulislam3
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
Dr.YNM
 
Microcontroller 8051 and its interfacing
Microcontroller 8051 and its interfacingMicrocontroller 8051 and its interfacing
Microcontroller 8051 and its interfacing
Ankur Mahajan
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
anil_gaur
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
Srikrishna Thota
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
ShivamSood22
 
Lecture #3 Flag Register.pptx
Lecture #3 Flag Register.pptxLecture #3 Flag Register.pptx
Lecture #3 Flag Register.pptx
ImranBhatti58
 
Interfacing of io device to 8085
Interfacing of io device to 8085Interfacing of io device to 8085
Interfacing of io device to 8085
Nitin Ahire
 
I/O port programming in 8051
I/O port programming in 8051I/O port programming in 8051
I/O port programming in 8051
ssuser3a47cb
 
8086 modes
8086 modes8086 modes
8086 modes
PDFSHARE
 
Introduction to Interrupts of 8085 microprocessor
Introduction to Interrupts of 8085 microprocessorIntroduction to Interrupts of 8085 microprocessor
Introduction to Interrupts of 8085 microprocessor
RAKESHCHOUDHARY164857
 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
Amit Kumer Podder
 

Viewers also liked (9)

8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
sb108ec
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van Neumann
Ravikumar Tiwari
 
Unit 4 memory system
Unit 4   memory systemUnit 4   memory system
Unit 4 memory system
chidabdu
 
Introduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIntroduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and Microcontrollers
Islam Samir
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
Aman Sharma
 
Addressing mode of 8051
Addressing mode of 8051Addressing mode of 8051
Addressing mode of 8051
Nitin Ahire
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
SARITHA REDDY
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
Mahesh Kumar Attri
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
Dr.YNM
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
sb108ec
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van Neumann
Ravikumar Tiwari
 
Unit 4 memory system
Unit 4   memory systemUnit 4   memory system
Unit 4 memory system
chidabdu
 
Introduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and MicrocontrollersIntroduction to Embedded Systems and Microcontrollers
Introduction to Embedded Systems and Microcontrollers
Islam Samir
 
8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C8051 programming skills using EMBEDDED C
8051 programming skills using EMBEDDED C
Aman Sharma
 
Addressing mode of 8051
Addressing mode of 8051Addressing mode of 8051
Addressing mode of 8051
Nitin Ahire
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
SARITHA REDDY
 
8096 microcontrollers notes
8096 microcontrollers notes8096 microcontrollers notes
8096 microcontrollers notes
Dr.YNM
 
Ad

Similar to Microcontroller directives (20)

8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
Stefan Oprea
 
Assembly_80x86- Assembly languages programming and 80x861.pdf
Assembly_80x86- Assembly languages programming and 80x861.pdfAssembly_80x86- Assembly languages programming and 80x861.pdf
Assembly_80x86- Assembly languages programming and 80x861.pdf
ahmedmohammed246810a
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
Ashim Saha
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
Education Front
 
Module 2 instruction set
Module 2 instruction set Module 2 instruction set
Module 2 instruction set
Deepak John
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
Ashim Saha
 
computer organization and assembly language.docx
computer organization and assembly language.docxcomputer organization and assembly language.docx
computer organization and assembly language.docx
alisoftwareengineer1
 
9_2019_01_06!10_26_04_PM.pptx what is register
9_2019_01_06!10_26_04_PM.pptx what is register9_2019_01_06!10_26_04_PM.pptx what is register
9_2019_01_06!10_26_04_PM.pptx what is register
chatlasrinithyasrini
 
8051 Programming (1).pptx
8051 Programming (1).pptx8051 Programming (1).pptx
8051 Programming (1).pptx
DhyeayaParmar
 
Wk1to4
Wk1to4Wk1to4
Wk1to4
raymondmy08
 
15CS44 MP & MC Module 1
15CS44 MP & MC Module 115CS44 MP & MC Module 1
15CS44 MP & MC Module 1
RLJIT
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
HimanshuPant41
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .
Siraj Ahmed
 
Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086
Urvashi Singh
 
12 mt06ped008
12 mt06ped008 12 mt06ped008
12 mt06ped008
vijaydeepakg
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
Manju Badiger
 
outline : basicc elements of assembly language
outline : basicc elements of assembly languageoutline : basicc elements of assembly language
outline : basicc elements of assembly language
rivadiab30663
 
Embedded system classes in mumbai
Embedded system classes in mumbaiEmbedded system classes in mumbai
Embedded system classes in mumbai
Vibrant Technologies & Computers
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
Thirunavakkarasu kannusamy
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
Dr. Pankaj Zope
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
Stefan Oprea
 
Assembly_80x86- Assembly languages programming and 80x861.pdf
Assembly_80x86- Assembly languages programming and 80x861.pdfAssembly_80x86- Assembly languages programming and 80x861.pdf
Assembly_80x86- Assembly languages programming and 80x861.pdf
ahmedmohammed246810a
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
Ashim Saha
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
Education Front
 
Module 2 instruction set
Module 2 instruction set Module 2 instruction set
Module 2 instruction set
Deepak John
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
Ashim Saha
 
computer organization and assembly language.docx
computer organization and assembly language.docxcomputer organization and assembly language.docx
computer organization and assembly language.docx
alisoftwareengineer1
 
9_2019_01_06!10_26_04_PM.pptx what is register
9_2019_01_06!10_26_04_PM.pptx what is register9_2019_01_06!10_26_04_PM.pptx what is register
9_2019_01_06!10_26_04_PM.pptx what is register
chatlasrinithyasrini
 
8051 Programming (1).pptx
8051 Programming (1).pptx8051 Programming (1).pptx
8051 Programming (1).pptx
DhyeayaParmar
 
15CS44 MP & MC Module 1
15CS44 MP & MC Module 115CS44 MP & MC Module 1
15CS44 MP & MC Module 1
RLJIT
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
HimanshuPant41
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .
Siraj Ahmed
 
Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086
Urvashi Singh
 
Arm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.pptArm Cortex material Arm Cortex material3222886.ppt
Arm Cortex material Arm Cortex material3222886.ppt
Manju Badiger
 
outline : basicc elements of assembly language
outline : basicc elements of assembly languageoutline : basicc elements of assembly language
outline : basicc elements of assembly language
rivadiab30663
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
Dr. Pankaj Zope
 
Ad

Recently uploaded (20)

Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 

Microcontroller directives

  • 1. Designed by Manoj D. Harsule Lecturer in Electronics & Communication Dept. G.H. Raisoni Polytechnic, Amravati, Maharashtra, India Microcontroller Basics Directives
  • 3. Editor Construct ALP Type using Editor Called as source program Extension .asm
  • 4. Assembler ALP to machine code Extension .obj or .lst
  • 5. Linker Combines more than one Converts to single executable
  • 6. Simulator Run 8051 program without using 8051 kit If not needed use Hex Converter Extension must be .hex
  • 7. Data Types  Sbit- special function reg.  Address- 80 H to FF H  Bit:- addressable RAM  00 H to 7FH
  • 8. Byte data type Addressable byte by byte No 16 bit word
  • 9. Directives are commands of assembly language itself and have no influence on the operation of the microcontroller 8051 DIRECTIVES
  • 10. EQU directive  The EQU directive is used to replace a number by a symbol.  Syntax: Name EQU Constant  For example:  MAXIMUM EQU 99 After using this directive, every appearance of the label “MAXIMUM” in the program will be interpreted by the assembler as the number 99 (MAXIMUM = 99). Symbols may be defined this way only once in the program. The EQU directive is mostly used at the beginning of the program therefore.
  • 11. SET directive  The SET directive is also used to replace a number by a symbol. The significant difference compared to the EQU directive is that the SET directive can be used an unlimited number of times:  SPEED SET 45SPEED SET 46SPEED SET 57
  • 12. BIT directive  The BIT directive is used to replace a bit address by a symbol. The bit address must be in the range of 0 to 255 (00 H to FF H).  Syntax: Name BIT 8051 bit  For example:  TRANSMIT BIT PSW.7; Transmit bit (the seventh bit in PSW register); is assigned the name “TRANSMIT”OUTPUT BIT 6 ;Bit at address 06 is assigned the name “OUTPUT”RELAY BIT 81 ;Bit at address 81 (Port 0)is assigned the name ;”RELAY”
  • 13. CODE directive  The CODE directive is used to assign a symbol to a program memory address. Since the maximum capacity of program memory is 64K, the address must be in the range of 0 to 65535(0000 H to FFFF H).  Syntax: Name CODE code address  For example:  RESET CODE 0 ;Memory location 00h called “RESET”TABLE CODE 1024
  • 14. DATA directive  The DATA directive is used to assign a symbol to an address within internal RAM and SFR. The address must be in the range of 0 to 255 (00 H to FF H). It is possible to change or assign a new name to any register.  Syntax: Name DATA data address  For example:  TEMP12 DATA 32 ;Register at address 32 is named ;as “TEMP12”STATUS_R DATA D0h ;PSW register is assigned the name ;”STATUS_R”
  • 15. IDATA directive  The IDATA directive is used to change or assign a new name to an indirectly addressed register. It is an address of entire internal RAM.  Syntax: Name IDATA idata address  For example:  TEMP22 IDATA 32 ;Register whose address is in register ;at address 32 is named as “TEMP22”TEMP33 IDATA T_ADR ;Register whose address is in ;register T_ADR is named as “TEMP33”
  • 16. XDATA directive  The XDATA directive is used to assign a name to registers within external (additional) RAM memory. The addresses of these registers cannot be larger than 65535 (0000 h to FFFF H).  Syntax: Name XDATA xdata address  For example:  TABLE_1 XDATA 2048 ;Register stored in external; memory at address 2048 is named; as “TABLE_1”
  • 17. ORG directive : Origin  The ORG directive is used to specify a location in program memory where the program following directive is to be placed.  Syntax: ORG address  Address can be given in either in hex or decimal.  For example:  BEGINNING ORG 100 ... ...ORG 1000hTABLE ... ...This program starts at location 100. The table containing data is to be stored at location 1024 (1000h).
  • 18. USING directive  The USING directive is used to define which register bank (registers R0-R7) is to be used in the program.  Syntax: USING Bank no.  USING 0 ;Bank 0 is used (registers R0-R7 at RAM-addresses 0-7)USING 1 ;Bank 1 is used (registers R0-R7 at RAM-addresses 8-15)USING 2 ,Bank 2 is used (registers R0-R7 at RAM- addresses 16-23)USING 3 ;Bank 3 is used (registers R0-R7 at RAM-addresses 24-31)
  • 19. END directive : End of program  The END directive is used at the end of every program. The assembler will stop compiling once the program encounters this directive.  Syntax: END  For example:  END ;End of program
  • 20. DB directive  The DB directive is used for writing specified value into program memory. If several values are specified, then they are separated by a comma. If ASCII array is specified, it should be enclosed within single quotation marks.  For example:CSEG DB 22,33,’Alarm’,44 If this directive is preceeded by a lable, then the label will point to the first element of the array. It is the number 22 in this example.