Chapter 03 · Watch, then practise
Programming with 8086 Microprocessor
Watch the related lecture, then read the question and answer below.
11 questions · 6 playlist videos. Matches are based on video titles; broader background matches are labeled.
Watch the full playlist ↓Chapter playlist
Programming with 8086 Microprocessor
8086 Microprocessor Architecture - Bharat Acharya
Bharat Acharya Education · 49:13
Choose a video · 3 lectures
Title-based matches for 8086 architecture, the bus interface unit and the execution unit.
1. 8086 internal block diagram
Draw the internal block diagram of 8086 microprocessor Explain the function of each component in brief.
Answer

BIU (Bus Interface Unit)
The BIU's instruction queue is a first in first out (FIFO) group of registers in which upto 6 bytes of instructions code are prefetched form memory a head of time.
CS (Code Segment Register) and IP (Instruction Pointer)
All program instructions must be located in memory pointed to by the 16 bits segment register CS and 16 bits offset contained in the 16 bit IP.
Stack Segment Register (SS) and Stack Pointer (SP)
The 20 bit physical stack address is calculated from SS and SP for stack instruction such as PUSH and POP.
Data Segment Register (DS)
The data segment register points to the current data segment, operands for most instructions are fetched from this segment.
Extra Segment Register (ES)
It points to extra segment in which data is used.
Execution Unit
EU decodes and executes the instructions.
AX, BX, CX, DX registers.
- AX register is 16 bit accumulator and AL is 8 bit accumulator
- BX is called base register whose contents can be used for addressing 8086 memory.
- CX is known as counter register. eg LOOP use content of CX as a counter.
- DX is data register used to hold 16 bit data
Stack pointer (SP) and Base Pointer (BP)
SP is used as offset form current SS during execution of instructions that involves stack operation.
BP is contains in offset address in the current SS.
Source index (SI) and Destination index (DI)
Thes are used in indexing address.
Flag registers.
The Flags are AF, CF, OF, SF, PF, ZF, DF, IF, TF.
8086 Microprocessor Architecture - Bharat Acharya
Bharat Acharya Education · 49:13
Choose a video · 3 lectures
Title-based matches for 8086 architecture and its two functional units; register-by-register coverage has not been verified.
2. 8086 programmer-accessible registers
Draw the internal architecture of 8086 microprocessor. Explain the function of each register accessible to programmer.
Answer

Code Segment Register (CS) and Instruction Pointer (IP)
All program instructions must be located in memory pointed to by the 16-bit segment register CS and a 16 bit offset contained in the 16 bit instruction pointer (IP).
Stack Segment Register (SS)
The stack segment register points to the current stack. The 20 bit physical stack address is calculated form the SS (stack segment) and SP (stack pointer) for the stack instructions such as POP and PUSH.
Data Segment Register.
The data segment register points to the current data segment, operands for most instructions are fetched from this segment.
Extra Segment Register.
The extra segment register points to the extra segment in which data is used.
AX register.
The AX register is 16 bit accumular and AL is 8 bit accumulator. AL register is same as 8085's accumulator
BX register.
BX register is called base register used for addressing 8086 memory.
CX register.
CX register is called counter register. Some instructions such as SHIFT, ROTATE and LOOP use the content of CX as counter.
DX register.
DX register or data register is used to hold a high 16 bit data.
Stack pointer (SP) and Base Pointer (BP)
SP is used as an offset form the current Stack Segment during execution of instruction that involve the stack segment.
BP contains in offset address in the current Stack Segment.
8086 microprocessor architecture | Bus interface unit | Part-1/2 | MPMC | Lec-10 | Bhanu Priya
Education 4u · 16:28
Choose a video · 2 lectures
Title-based matches for the bus interface unit and execution unit. The playlist titles do not identify a full assembly-operator lesson.
3. BIU, EU and assembly operators
Discuss and differentiate between Bus Interface Unit (BIU) and Execution Unit (EU) of 8086 Microprocessor List out the operators used in 8086 Assembly Language Programming.
Answer
BIU's instruction queue is first in first out (FIFO) group of registers in which upto 6 bytes of instruction code are pre-fetched from memory a head of time. BIU contains a dedicated address which is used to produce the 20 bit address. BIU also has four 16 bit registers: Code segment (CS), data segment (DS), stack segment (SS) and extra segment (ES).
EU decodes and executes the instructions EU has 16 bit ALU for performing the Arithmetic and Logical operations. EU has nine 16 bit registers: AX, BX, CX, DX, SP, BP, SI and DI.
In BIU, if the queue is full and EU does not request BIU to access memory the BIU does not perform any bus cycle. On the other hand, if BIU is not full and if it BIU is not full and if it can store at least 2 byte and the EU does not request it to access memory, the BIU may prefetch instructions. However, if BIU is interrupted by the EU for memory access while the BIU is in process of fetching an instruction, the BIU first completes fetching and then services the EU.

No video specifically titled 8086 addressing modes appears in this chapter playlist.
4. 8086 addressing modes
What do you mean by Addressing mode? Explain different addressing modes of 8086 microprocessor along with examples.
Answer
Addressing mode.
Addressing mode is the method of giving address to the instruction operands.
Different addressing modes of 8086 microprocessor are:-
Register and immediate addressing (Direct) mode
In register addressing mode, the source operands, destination operands or both may be contained in registers. In immediate addressing, 8 bit or 16 bit data can be part of instruction

Register indirect Addressing.
In this mode, the effective address of memory operands is taken directly from one of the base or index register such as BX, BP, SI, DI,

Based Address
In this mode, the effective address is the sum of the displacement and the content of the register BX or BP.

Indexed Address
In this mode, the effective address is the calculated from the sum of a displacement value and the content of a register SI or DI

Base Indexed Address
In this mode, the effective address is computed from the sum of a base register (BX or BP), an index register (SI or DI) and a displacement.

String Address
This mode uses index registers, where SI is used to point to the first byte or word of the string and DI is used to point to the first byte or word of the destination, when a string instruction is executed.
Assembler Directives- OPEN BOX Education
OPENBOX Education · 23:05
Choose a video · 2 lectures
Title-based matches for assembler directives and assembly language. These are related lessons, not a verified answer to every clause.
5. Assembly statements and directives
What do you mean statements in assembly language programming? Explain different directive that are frequently used in assembly language programming.
Answer

DOSSEG
The DOSSEG directive tells MASM to place the segment in the standard order. One can place the segments in any order in the source program.
Model directive
The mode directive selects a standard memory model for the program.
.STACK
The STACK directive sets the size of the program stack, which may be any size up to 64k.
.CODE
The CODE directive identifies the part of the program that contains instruction.
PROC
The PROC directive create a name and an address for the beginning of a procedure.
ENDP
The ENDP directive marks the end of a procedure.
.DATA
All the variables are defined in the area following the .DATA directive.
END
The END directive terminates assembly of the program and any statements after it are ignored.
8086 microprocessor architecture | Execution unit | Part-2/2 | MPMC | Lec-11 | Bhanu Priya
Education 4u · 18:20
Choose a video · 2 lectures
Related background based on titles: execution-unit architecture and arithmetic instructions. Full flag and assembler-operator coverage has not been verified.
6. 8086 flags and operators
What is flag? Describe the condition and control flags of 8086 briefly? Describe commonly used operators in 8086 assembly language programming with suitable example.
Answer

The 8086 have nine flags.
i) AF (Auxiliary Flag)
AF is set if there is a carry form the lower nibble into the higher nibble or borrow form lower nibble into the higher nibble.
ii) CF (Carry Flag)
CF is set if there is a carry or a borrow
iii) OF (Overflow Flag)
OF is set if there is an arithmetic overflow, i.e. if the size of the result exceeds the capacity of the destination location.
iv) SF (Sign Flag)
SF is set if MSB of result is 1.
v) PF (Parity Flag)
PF is set if the result have even parity
vi) ZF (Zero Flag)
ZF is set if the result is zero.
vii) DF (Direction Flag)
Setting DF causes string instruction to auto decrement.
viii) IF (Interrupt Flag)
Setting IF causes 8086 to recognize external maskable interrupts.
ix) TF (Trap flag)
Setting TR puts the 8086 in the single step. mode.
The commonly used operators in 8086 assembly programming language are described below.

ii) Boolean operators.
AND, OR, XOR, NOT are boolean operators.





Assembler Directives- OPEN BOX Education
OPENBOX Education · 23:05
Related title-based match for assembler directives. NEAR/FAR procedure coverage has not been verified.
7. Procedures and ending statements
Explain the purpose of a procedure. Explain when you define the procedure as NEAR and FAR in assembly programming. What statements are concerned with ending (a) a procedure (b) a segment (c) a program.
Answer

When writing a program we will find that we need to use a particular sequence of instructions at several different points in a program. To avoid writing the same sequence of program each time we need them, we can write the sequence as a separate "subprogram" that is procedure.

What is Assembler and Assembly Language (in Hindi)
Last moment tuitions · 7:54
Title-based background on assemblers and assembly language. One-pass/two-pass details, linking and loading are not confirmed by the title.
8. Assembling, linking and execution
What do you understand by assembling, linking & executing process? Explain one pass and two pass assemblers.
Answer
Assembling
It involves translating the source code into object code with the help of assembler. This process creates an object file with .OBJ extension which is machine understandable but not directly executable. The assembler also creates .LST and .CRF files.
Linking
The process of converting the object file into executable file is called linking. The linker completes any address left over by the assembler and combines separately assembled programs into one executable module.
Executing
This loads the program in RAM for execution The loader knows where the program is to be loaded in memory, able to resolve any remaining address, still left incomplete in the header.
One pass assemble.
This assembler goes through the assembly language program once and translate the assembly language program. The one pass assembler must have forward reference. If one pass assembler have no such program to define forward reference the user must define it after the program is assembled.
Two pass assembler
This assembler goes through the assembly language twice.
During first pass, the assembler reads the entire source program and construct a symbol tables of names and labels used in the program
During second pass, the assembler uses the symbol table that is constructed in first pass and converts it to object code.
No attribute-byte or text-video-format lesson is identified in this chapter playlist.
9. Attribute byte format
Describe the attribute byte format. Write the values of attribute byte for:
a) Normal video
b) Reverse video
c) Background green, Foreground gray
Answer

What is Assembler and Assembly Language (in Hindi)
Last moment tuitions · 7:54
Choose a video · 2 lectures
Title-based related lessons on assembly language and assembler directives. Reserved-word and identifier coverage has not been verified.
10. Reserved words and identifiers
Define the terms reserved words and identifier in assembly language with examples. Also differentiate between an instruction and a directive with example of each.
Answer
Reserved words
These are the names or words which are reserved for special purposes in a program.
eg.
- instructions (mov, add etc)
- directives (END, SEGMENT, etc)
- operators (offset, seg, etc)
- predefined symbols (@data, etc)
Identifier
Identifier is a name given to represent an item in a program.

Instruction are the set of codes that performs various operation on the microprocessor
eg. MOV, INC, etc.
Directives are the number of statements that enables us to control the way in which source code assembles.
eg. SEGMENT directives.
8086 microprocessor architecture | Bus interface unit | Part-1/2 | MPMC | Lec-10 | Bhanu Priya
Education 4u · 16:28
Background on the bus interface unit based on the video title. The title does not explicitly identify segment/offset address calculations.
11. Segment and offset address

Answer
Segment
Segment are used to identify a group of data item or group of instructions that are kept together. These are identified by SEGMENT and ENDS directives.