SlideShare a Scribd company logo
1 of 20
Department of Electrical and Electronic
Engineering
Khulna University of Engineering & Technology
Khulna-9203
Course code : EE 3214
Sessional on
Microprocessors, Micro-controllers and Peripherals
Presented By
Amit Kumer Podder
Experiment No. 06
(a) Introduction to 8086 assembly language
programming
(b)Introduction to serial monitor operation of
MDA-Win 8086 trainer kit
Experiment Name
7/3/2020 Amit Kumer Podder 2
The memory in 8086 systems is segmented with segments like code, data,
stack and extra segment.
While writing the assembly the beginning and end of different segments are
to be clearly indicated. This is done by segment directive.
Assembler Directive: a statement to give direction to the assembler
to perform task of the assembly process.
 Indicate how an operand or a section of the program is to be
processed by the assembler
It consists of two types of statements: instructions and directives
 Instructions: translated to the machine code by the assembler
 Directives are not translated to the machine codes
Assembler Directives
7/3/2020 Amit Kumer Podder 3
● SYMBOLS: to signify different components of the ALP (assembly Language
Program)
 Symbols consist of following characters:-
 Upper case & lower case alphabets: A to Z; a to z
 Digits: 0 to 9
 Special characters: $, ?, @, _ (underscore)
 No distinction between an uppercase and lowercase letter
 A hexadecimal no. starting with A to F must begin with “0” (zero) ; otherwise will be
taken as a symbol
● VARIABLE: these are symbols whose values can be varied while running a program
 Names of variables: should be meaningful to make program maintenanceeasy
 A variable can use: A to Z; a to z; 0 to 9; @; _ (underscore)
 Digit can not be used as 1st character of an Assembler variable
● CONSTANT: these are symbols whose values can not be varies while running a
program
 A numeric constant may be a binary, decimal or hexadecimal number.
 Symbols B, D & H must be used at the end of a binary, decimal
and hexadecimalnumber, respectively.
Important terms and rules
7/3/2020 Amit Kumer Podder 4
● Data declaration directives: DB, DW, DD, DQ, DT
● ASSUME
● END directives
● EQU Directive
● PROC
● ORG
● SEGMENT
● GROUP, INCLUDE, EVEN, ALIGN
● EXTRN, PUBLIC,
● TYPE, PTR,
● LENGTH, OFFSET
● NAME, LABEL, SHORT, GLOBAL
Assembler Directives
7/3/2020 Amit Kumer Podder 5
8086 supports Different data types. The data types unlike in high level language
which use keywords like INT, char, float etc., 8086 treats everything as a bytes
and according have directives for declaring type for Single byte, two byte ( a
word), double word, quad words, ten bytes etc, These are-
DB - Defined Byte. DB declares a variable of type byte and reserves one location in
memory for the variable of type byte.
Example
num1 DB 15h
DW – Defined Word. The DW directive is used to declare a WORD type
variable - A WORD occupies 16 bits or (2 BYTE).
● examples:
 WORDS DW 1234H, 3456H; Declares an array of 2 words and initialize them with
thespecified values
DD - Defined Double Word. The DD directive is used to declare a DWORD
- A DWORD double word is made up of 32 bits =2 Word's or 4 BYTE.
● examples:
 ARRAY DD 25629261H;
Data Declaration Directives
7/3/2020 Amit Kumer Podder 6
DQ-Define Quadword
This directive is used to define a variable of type quadword or to
reserve storage location of type quadword in memory. For example
Quad_word DQ 1234123412341234H
DT-Define Ten Bytes
This directive is used to define a variable which is 10 bytes in
length or to reserve 10 bytes of storage in the memory. For example
Ten_bytes DT 11223344556677889900
Data Declaration Directives
7/3/2020 Amit Kumer Podder 7
ORG directive: This directive instructs the assembler to start the
program in memory from the offset mentioned in the argument of
ORG.
● The ORG directive allows you to set the location counter
to a desired value at any point in the program.
Example:
 The statement ORG 2000H tells the assembler
to set the location counter to 2000H.
Origin Directives
7/3/2020 Amit Kumer Podder 8
● END - End Program
● ENDP - End Procedure
● ENDS - End Segment
● END – it signifies the end of the program module
 The assembler will ignore any statement after an END
directive
● ENDP - indicates the end of a procedure
 Syntax: Procedure_name ENDP
● ENDS - indicates the end of a logical segment
 Syntax: Segment_name ENDS
End Directives
7/3/2020 Amit Kumer Podder 9
PROC (Procedure) Directive
● PROC - The PROC directive is used to identify the
start of a procedure. The term near or far is used to
specify the type of the procedure.
● Example:
 SMART PROC FAR ; This identifies that the start of a
procedure named as SMART and instructs the assembler that
the procedure is far .
7/3/2020 Amit Kumer Podder 10
● ASSUME Directive - The ASSUME directive is used to tell the
assembler that the name of the logical segment should be used
for a specified segment. The 8086 works directly with only 4
physical segments: a Code segment, a data segment, a stack
segment, and an extra segment.
Example:
● ASSUME CS:CODE ;This tells the assembler that the logical
segment named CODE contains the instruction statements for
the program and should be treated as a code segment.
● ASSUME DS:DATA ;This tells the assembler that for any
instruction which refers to a data in the data segment, data
will found in the logical segment DATA.
Assume Directives
7/3/2020 Amit Kumer Podder 11
The offset directive will be used where the offset from starting of the segment is
required in the program. The example of OFFSET is:
MOV SI, OFFSET string1; copies the offset of string1 in SI register
OFFSET directive
DUP directive is used to duplicate the basic data definition 'n' number of times;
or saying it the other way is that DUP is used to declare array of Size n.
ARRY DB 10 dup (0), declares array of 10 byte.
DUP directive
This directive is used to instruct the assembler that a Specified name or label will
be accessed from other modules.
Example: PUBLIC MULIPLIER, INTEREST_RATE
PUBLIC directive
Other Directives
7/3/2020 Amit Kumer Podder 12
Equate (EQU) Directive
● EQU - This EQU directive is used to give a name to some
value or to a symbol. Each time the assembler finds the
name in the program, it will replace the name with the
value or symbol you given to that name.
● Example:
 FACTOR EQU 03H ; you has to write this statement at the starting
of your program
 later in the program you can use this as follows :
 ADD AL, FACTOR ;
7/3/2020 Amit Kumer Podder 13
TYPE, PTR(POINTER)
● TYPE - instructs the assembler to determine the type of a variable and
determines the number of bytes specified to that variable.
Example:
 Byte type variable – assembler will give a value 1 Word type variable – assembler will
give avalue 2 Double word type variable – assembler will give a value 4 ADD BX, TYPE
WORD_ ARRAY ; hear we want to increment BX to point to next word in an array of
words.
● PTR (POINTER) : used to assign a specific type to a variable or a label. It is
necessary to do this in any instruction where the type of the operand is not
clear.
Example:
 INC [BX]; It will not know whether to increment the byte pointed to by BX. We use
thePTR operator to clarify how we want the assembler to code the instruction.
 INC BYTE PTR [BX] ; This statement tells the assembler that we want to increment
thebyte pointed to by BX.
 INC WORD PTR [BX] ; This statement tells the assembler that we want to increment
theword pointed to by BX. The PTR operator assigns the type specified before PTR to the
variable specified after PTR.
7/3/2020 Amit Kumer Podder 14
8086 Programming using Assembler Directives
●Basic structure of a program:
Name_data segment SEGMENT
Data declaration statement 1
:
:
Data declaration statement n
DATA ENDS
Name_codeseg SEGMENT
ASSUME CS:CODE, DS:DATA, ES:EXTRA, SS: STACK
START:
Program line 1
:
:
Program line n
Name_codeseg ENDS
END START
7/3/2020 Amit Kumer Podder 15
● Program to multiply 2 16-bit words in memory locations called MULTIPLICAND
and MULTIPLIER. Result is stored in memory location PRODUCT.
DATA SEGMENT
MULTIPLICAND DW 204A H; 1ST Word
MULTIPLIER DW 3B2A H; 2nd word
PRODUCT DW 2 DUP(0); sets aside storage for 2 words in memory and gives starting address of 1st word
the name PRODUCT. The DUP(0) part of the statement tells assembler to initialize 2 words to all zeros.
DATA ENDS
CODE SEGMENT
ASSUMER CS:CODE, DS:DATA;
START:
MOV AX, DATA
MOV DS, AX
MOV AX, MULTIPLICAND;
MUL MULTIPLIER;
MOV PRODUCT, AX;
MOV PRODUCT+2, DX;
INT 3
CODE ENDS
END START
Example
7/3/2020 Amit Kumer Podder 16
Recapitulations of Addressing Mode
7/3/2020 Amit Kumer Podder 17
Recapitulations of Addressing Mode
7/3/2020 Amit Kumer Podder 18
Now Start Programming on
MDA-Win 8086 Training Kit
7/3/2020 Amit Kumer Podder 19
Program : To study different addressing modes of 8086 Microprocessor
CODE SEGMENT
ASSUME CS:CODE, DS:CODE, ES:CODE, SS:CODE;
ORG 1000H
MOV AX,0001H
MOV DS,AX
MOV ES,AX
;
MOV BX,2000H
MOV AX,[BX]
MOV CH,[BX+2]
MOV CL,[BX+3]
;
MOV BP,BX
MOV DX,DS:[BP+4]
MOV SI,ES:[BP+6]
MOV BX,[BP+8]
INT 3;
CODE ENDS
END.
7/3/2020 Amit Kumer Podder 20

More Related Content

What's hot

Chapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional InstructionsChapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional Instructionscmkandemir
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer languageSanjeev Patel
 
Code Conversion in 8085 Microprocessor
Code Conversion in 8085 MicroprocessorCode Conversion in 8085 Microprocessor
Code Conversion in 8085 MicroprocessorMOHIT AGARWAL
 
Logical micro-operations
Logical micro-operationsLogical micro-operations
Logical micro-operationsVATSAL TRIVEDI
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operationNikhil Pandit
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerJay Makwana
 
Digital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-IDigital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-Ipravinwj
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programmingWondeson Emeye
 
Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Vikas Dongre
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructorsPraveen M Jigajinni
 
Programmable peripheral interface 8255
Programmable peripheral interface 8255Programmable peripheral interface 8255
Programmable peripheral interface 8255Marajulislam3
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic NotationsRishabh Soni
 
Special of 80386 registers
Special of 80386 registersSpecial of 80386 registers
Special of 80386 registersTanmoy Mazumder
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)cs19club
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionBadrul Alam
 
Digital systems
Digital systemsDigital systems
Digital systemsraj aditay
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051SARITHA REDDY
 

What's hot (20)

Chapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional InstructionsChapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional Instructions
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
Code Conversion in 8085 Microprocessor
Code Conversion in 8085 MicroprocessorCode Conversion in 8085 Microprocessor
Code Conversion in 8085 Microprocessor
 
Logical micro-operations
Logical micro-operationsLogical micro-operations
Logical micro-operations
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Timer And Counter in 8051 Microcontroller
Timer And Counter in 8051 MicrocontrollerTimer And Counter in 8051 Microcontroller
Timer And Counter in 8051 Microcontroller
 
Pointers in C/C++ Programming
Pointers in C/C++ ProgrammingPointers in C/C++ Programming
Pointers in C/C++ Programming
 
Digital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-IDigital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-I
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programming
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051Interrupts programming in embedded C using 8051
Interrupts programming in embedded C using 8051
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructors
 
Programmable peripheral interface 8255
Programmable peripheral interface 8255Programmable peripheral interface 8255
Programmable peripheral interface 8255
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Special of 80386 registers
Special of 80386 registersSpecial of 80386 registers
Special of 80386 registers
 
Floating point arithmetic operations (1)
Floating point arithmetic operations (1)Floating point arithmetic operations (1)
Floating point arithmetic operations (1)
 
Logical, Shift, and Rotate Instruction
Logical, Shift, and Rotate InstructionLogical, Shift, and Rotate Instruction
Logical, Shift, and Rotate Instruction
 
Digital systems
Digital systemsDigital systems
Digital systems
 
I o ports and timers of 8051
I o ports and timers of 8051I o ports and timers of 8051
I o ports and timers of 8051
 
Ch12 microprocessor interrupts
Ch12 microprocessor interruptsCh12 microprocessor interrupts
Ch12 microprocessor interrupts
 

Similar to 8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit

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 8086Urvashi Singh
 
06 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa1606 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa16John Todora
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 prsamurti
 
Microcontroller directives
Microcontroller directivesMicrocontroller directives
Microcontroller directivesManoj Harsule
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 prsamurti
 
Intel µp instruction encoding and decoding
Intel µp instruction encoding and decodingIntel µp instruction encoding and decoding
Intel µp instruction encoding and decodingyocirem
 
assembler Directives hnotesnnnnnnnn.pptx
assembler Directives hnotesnnnnnnnn.pptxassembler Directives hnotesnnnnnnnn.pptx
assembler Directives hnotesnnnnnnnn.pptxDrkoteswararaoseelam
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 
Module 2 instruction set
Module 2 instruction set Module 2 instruction set
Module 2 instruction set Deepak John
 
Freertos based environmental data acquisition using arm cortex m4 f core
Freertos based environmental data acquisition using arm cortex m4 f coreFreertos based environmental data acquisition using arm cortex m4 f core
Freertos based environmental data acquisition using arm cortex m4 f coreeSAT Journals
 

Similar to 8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit (20)

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
 
06 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa1606 chapter03 04_control_logix_tags_memory_structure_fa16
06 chapter03 04_control_logix_tags_memory_structure_fa16
 
report-MICRO-P (2).pptx
report-MICRO-P (2).pptxreport-MICRO-P (2).pptx
report-MICRO-P (2).pptx
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 p
 
unit-2.pptx
unit-2.pptxunit-2.pptx
unit-2.pptx
 
Micro overview
Micro overviewMicro overview
Micro overview
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptx
 
Microcontroller directives
Microcontroller directivesMicrocontroller directives
Microcontroller directives
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 p
 
8086 Microprocessor
8086 Microprocessor8086 Microprocessor
8086 Microprocessor
 
Mod02 compilers
Mod02 compilersMod02 compilers
Mod02 compilers
 
Intel µp instruction encoding and decoding
Intel µp instruction encoding and decodingIntel µp instruction encoding and decoding
Intel µp instruction encoding and decoding
 
DSP_Assign_1
DSP_Assign_1DSP_Assign_1
DSP_Assign_1
 
assembler Directives hnotesnnnnnnnn.pptx
assembler Directives hnotesnnnnnnnn.pptxassembler Directives hnotesnnnnnnnn.pptx
assembler Directives hnotesnnnnnnnn.pptx
 
Qb microprocessors
Qb microprocessorsQb microprocessors
Qb microprocessors
 
C programming session10
C programming  session10C programming  session10
C programming session10
 
Embedded C programming session10
Embedded C programming  session10Embedded C programming  session10
Embedded C programming session10
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Module 2 instruction set
Module 2 instruction set Module 2 instruction set
Module 2 instruction set
 
Freertos based environmental data acquisition using arm cortex m4 f core
Freertos based environmental data acquisition using arm cortex m4 f coreFreertos based environmental data acquisition using arm cortex m4 f core
Freertos based environmental data acquisition using arm cortex m4 f core
 

More from Amit Kumer Podder

Familiarization of electronic equipment
Familiarization of electronic equipmentFamiliarization of electronic equipment
Familiarization of electronic equipmentAmit Kumer Podder
 
Arduino Programming on Motor Control
Arduino Programming on Motor ControlArduino Programming on Motor Control
Arduino Programming on Motor ControlAmit Kumer Podder
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming FamiliarizationAmit Kumer Podder
 
8254 Programmable Interval Timer
8254 Programmable Interval Timer8254 Programmable Interval Timer
8254 Programmable Interval TimerAmit Kumer Podder
 
Dot Matrix LED Interfacing using 8255 PPI
Dot Matrix LED Interfacing using 8255 PPIDot Matrix LED Interfacing using 8255 PPI
Dot Matrix LED Interfacing using 8255 PPIAmit Kumer Podder
 
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 KitAmit Kumer Podder
 
Traffic Light Controller using 8255
Traffic Light Controller using 8255Traffic Light Controller using 8255
Traffic Light Controller using 8255Amit Kumer Podder
 
8255 Programmble Peripheral Interface
8255 Programmble Peripheral Interface8255 Programmble Peripheral Interface
8255 Programmble Peripheral InterfaceAmit Kumer Podder
 
8085 Microprocessor Programming and Instruction set
8085 Microprocessor Programming and Instruction set8085 Microprocessor Programming and Instruction set
8085 Microprocessor Programming and Instruction setAmit Kumer Podder
 
Micro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsMicro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsAmit Kumer Podder
 
Lecture on wire splicing and termination
Lecture on wire splicing and terminationLecture on wire splicing and termination
Lecture on wire splicing and terminationAmit Kumer Podder
 

More from Amit Kumer Podder (13)

Power Amplifier
Power AmplifierPower Amplifier
Power Amplifier
 
Familiarization of electronic equipment
Familiarization of electronic equipmentFamiliarization of electronic equipment
Familiarization of electronic equipment
 
Transducer
Transducer Transducer
Transducer
 
Arduino Programming on Motor Control
Arduino Programming on Motor ControlArduino Programming on Motor Control
Arduino Programming on Motor Control
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
8254 Programmable Interval Timer
8254 Programmable Interval Timer8254 Programmable Interval Timer
8254 Programmable Interval Timer
 
Dot Matrix LED Interfacing using 8255 PPI
Dot Matrix LED Interfacing using 8255 PPIDot Matrix LED Interfacing using 8255 PPI
Dot Matrix LED Interfacing using 8255 PPI
 
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
 
Traffic Light Controller using 8255
Traffic Light Controller using 8255Traffic Light Controller using 8255
Traffic Light Controller using 8255
 
8255 Programmble Peripheral Interface
8255 Programmble Peripheral Interface8255 Programmble Peripheral Interface
8255 Programmble Peripheral Interface
 
8085 Microprocessor Programming and Instruction set
8085 Microprocessor Programming and Instruction set8085 Microprocessor Programming and Instruction set
8085 Microprocessor Programming and Instruction set
 
Micro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and PeripheralsMicro-processor, Micro-controller and Peripherals
Micro-processor, Micro-controller and Peripherals
 
Lecture on wire splicing and termination
Lecture on wire splicing and terminationLecture on wire splicing and termination
Lecture on wire splicing and termination
 

Recently uploaded

Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 

8086 Assembly Language and Serial Monitor Operation of 8086 Trainer Kit

  • 1. Department of Electrical and Electronic Engineering Khulna University of Engineering & Technology Khulna-9203 Course code : EE 3214 Sessional on Microprocessors, Micro-controllers and Peripherals Presented By Amit Kumer Podder Experiment No. 06
  • 2. (a) Introduction to 8086 assembly language programming (b)Introduction to serial monitor operation of MDA-Win 8086 trainer kit Experiment Name 7/3/2020 Amit Kumer Podder 2
  • 3. The memory in 8086 systems is segmented with segments like code, data, stack and extra segment. While writing the assembly the beginning and end of different segments are to be clearly indicated. This is done by segment directive. Assembler Directive: a statement to give direction to the assembler to perform task of the assembly process.  Indicate how an operand or a section of the program is to be processed by the assembler It consists of two types of statements: instructions and directives  Instructions: translated to the machine code by the assembler  Directives are not translated to the machine codes Assembler Directives 7/3/2020 Amit Kumer Podder 3
  • 4. ● SYMBOLS: to signify different components of the ALP (assembly Language Program)  Symbols consist of following characters:-  Upper case & lower case alphabets: A to Z; a to z  Digits: 0 to 9  Special characters: $, ?, @, _ (underscore)  No distinction between an uppercase and lowercase letter  A hexadecimal no. starting with A to F must begin with “0” (zero) ; otherwise will be taken as a symbol ● VARIABLE: these are symbols whose values can be varied while running a program  Names of variables: should be meaningful to make program maintenanceeasy  A variable can use: A to Z; a to z; 0 to 9; @; _ (underscore)  Digit can not be used as 1st character of an Assembler variable ● CONSTANT: these are symbols whose values can not be varies while running a program  A numeric constant may be a binary, decimal or hexadecimal number.  Symbols B, D & H must be used at the end of a binary, decimal and hexadecimalnumber, respectively. Important terms and rules 7/3/2020 Amit Kumer Podder 4
  • 5. ● Data declaration directives: DB, DW, DD, DQ, DT ● ASSUME ● END directives ● EQU Directive ● PROC ● ORG ● SEGMENT ● GROUP, INCLUDE, EVEN, ALIGN ● EXTRN, PUBLIC, ● TYPE, PTR, ● LENGTH, OFFSET ● NAME, LABEL, SHORT, GLOBAL Assembler Directives 7/3/2020 Amit Kumer Podder 5
  • 6. 8086 supports Different data types. The data types unlike in high level language which use keywords like INT, char, float etc., 8086 treats everything as a bytes and according have directives for declaring type for Single byte, two byte ( a word), double word, quad words, ten bytes etc, These are- DB - Defined Byte. DB declares a variable of type byte and reserves one location in memory for the variable of type byte. Example num1 DB 15h DW – Defined Word. The DW directive is used to declare a WORD type variable - A WORD occupies 16 bits or (2 BYTE). ● examples:  WORDS DW 1234H, 3456H; Declares an array of 2 words and initialize them with thespecified values DD - Defined Double Word. The DD directive is used to declare a DWORD - A DWORD double word is made up of 32 bits =2 Word's or 4 BYTE. ● examples:  ARRAY DD 25629261H; Data Declaration Directives 7/3/2020 Amit Kumer Podder 6
  • 7. DQ-Define Quadword This directive is used to define a variable of type quadword or to reserve storage location of type quadword in memory. For example Quad_word DQ 1234123412341234H DT-Define Ten Bytes This directive is used to define a variable which is 10 bytes in length or to reserve 10 bytes of storage in the memory. For example Ten_bytes DT 11223344556677889900 Data Declaration Directives 7/3/2020 Amit Kumer Podder 7
  • 8. ORG directive: This directive instructs the assembler to start the program in memory from the offset mentioned in the argument of ORG. ● The ORG directive allows you to set the location counter to a desired value at any point in the program. Example:  The statement ORG 2000H tells the assembler to set the location counter to 2000H. Origin Directives 7/3/2020 Amit Kumer Podder 8
  • 9. ● END - End Program ● ENDP - End Procedure ● ENDS - End Segment ● END – it signifies the end of the program module  The assembler will ignore any statement after an END directive ● ENDP - indicates the end of a procedure  Syntax: Procedure_name ENDP ● ENDS - indicates the end of a logical segment  Syntax: Segment_name ENDS End Directives 7/3/2020 Amit Kumer Podder 9
  • 10. PROC (Procedure) Directive ● PROC - The PROC directive is used to identify the start of a procedure. The term near or far is used to specify the type of the procedure. ● Example:  SMART PROC FAR ; This identifies that the start of a procedure named as SMART and instructs the assembler that the procedure is far . 7/3/2020 Amit Kumer Podder 10
  • 11. ● ASSUME Directive - The ASSUME directive is used to tell the assembler that the name of the logical segment should be used for a specified segment. The 8086 works directly with only 4 physical segments: a Code segment, a data segment, a stack segment, and an extra segment. Example: ● ASSUME CS:CODE ;This tells the assembler that the logical segment named CODE contains the instruction statements for the program and should be treated as a code segment. ● ASSUME DS:DATA ;This tells the assembler that for any instruction which refers to a data in the data segment, data will found in the logical segment DATA. Assume Directives 7/3/2020 Amit Kumer Podder 11
  • 12. The offset directive will be used where the offset from starting of the segment is required in the program. The example of OFFSET is: MOV SI, OFFSET string1; copies the offset of string1 in SI register OFFSET directive DUP directive is used to duplicate the basic data definition 'n' number of times; or saying it the other way is that DUP is used to declare array of Size n. ARRY DB 10 dup (0), declares array of 10 byte. DUP directive This directive is used to instruct the assembler that a Specified name or label will be accessed from other modules. Example: PUBLIC MULIPLIER, INTEREST_RATE PUBLIC directive Other Directives 7/3/2020 Amit Kumer Podder 12
  • 13. Equate (EQU) Directive ● EQU - This EQU directive is used to give a name to some value or to a symbol. Each time the assembler finds the name in the program, it will replace the name with the value or symbol you given to that name. ● Example:  FACTOR EQU 03H ; you has to write this statement at the starting of your program  later in the program you can use this as follows :  ADD AL, FACTOR ; 7/3/2020 Amit Kumer Podder 13
  • 14. TYPE, PTR(POINTER) ● TYPE - instructs the assembler to determine the type of a variable and determines the number of bytes specified to that variable. Example:  Byte type variable – assembler will give a value 1 Word type variable – assembler will give avalue 2 Double word type variable – assembler will give a value 4 ADD BX, TYPE WORD_ ARRAY ; hear we want to increment BX to point to next word in an array of words. ● PTR (POINTER) : used to assign a specific type to a variable or a label. It is necessary to do this in any instruction where the type of the operand is not clear. Example:  INC [BX]; It will not know whether to increment the byte pointed to by BX. We use thePTR operator to clarify how we want the assembler to code the instruction.  INC BYTE PTR [BX] ; This statement tells the assembler that we want to increment thebyte pointed to by BX.  INC WORD PTR [BX] ; This statement tells the assembler that we want to increment theword pointed to by BX. The PTR operator assigns the type specified before PTR to the variable specified after PTR. 7/3/2020 Amit Kumer Podder 14
  • 15. 8086 Programming using Assembler Directives ●Basic structure of a program: Name_data segment SEGMENT Data declaration statement 1 : : Data declaration statement n DATA ENDS Name_codeseg SEGMENT ASSUME CS:CODE, DS:DATA, ES:EXTRA, SS: STACK START: Program line 1 : : Program line n Name_codeseg ENDS END START 7/3/2020 Amit Kumer Podder 15
  • 16. ● Program to multiply 2 16-bit words in memory locations called MULTIPLICAND and MULTIPLIER. Result is stored in memory location PRODUCT. DATA SEGMENT MULTIPLICAND DW 204A H; 1ST Word MULTIPLIER DW 3B2A H; 2nd word PRODUCT DW 2 DUP(0); sets aside storage for 2 words in memory and gives starting address of 1st word the name PRODUCT. The DUP(0) part of the statement tells assembler to initialize 2 words to all zeros. DATA ENDS CODE SEGMENT ASSUMER CS:CODE, DS:DATA; START: MOV AX, DATA MOV DS, AX MOV AX, MULTIPLICAND; MUL MULTIPLIER; MOV PRODUCT, AX; MOV PRODUCT+2, DX; INT 3 CODE ENDS END START Example 7/3/2020 Amit Kumer Podder 16
  • 17. Recapitulations of Addressing Mode 7/3/2020 Amit Kumer Podder 17
  • 18. Recapitulations of Addressing Mode 7/3/2020 Amit Kumer Podder 18
  • 19. Now Start Programming on MDA-Win 8086 Training Kit 7/3/2020 Amit Kumer Podder 19
  • 20. Program : To study different addressing modes of 8086 Microprocessor CODE SEGMENT ASSUME CS:CODE, DS:CODE, ES:CODE, SS:CODE; ORG 1000H MOV AX,0001H MOV DS,AX MOV ES,AX ; MOV BX,2000H MOV AX,[BX] MOV CH,[BX+2] MOV CL,[BX+3] ; MOV BP,BX MOV DX,DS:[BP+4] MOV SI,ES:[BP+6] MOV BX,[BP+8] INT 3; CODE ENDS END. 7/3/2020 Amit Kumer Podder 20