0% found this document useful (0 votes)
86 views17 pages

MIC Unit1 Solutions

The document discusses features of the 8086 microprocessor including its registers, pins, bus interface unit functions, and memory segmentation. It also covers the assembly language programming process, tools used, and directives like EQU and STRUCT.

Uploaded by

jeyini6818
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views17 pages

MIC Unit1 Solutions

The document discusses features of the 8086 microprocessor including its registers, pins, bus interface unit functions, and memory segmentation. It also covers the assembly language programming process, tools used, and directives like EQU and STRUCT.

Uploaded by

jeyini6818
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

CHAPTER1: 8086-16 Bit Microprocessor (CO1) (14 Marks)

2 Marks

1 List any four features of 8086

The four features of 8086 microprocessor are:


1. It is a 16-bit microprocessor.
2. It has a 20-bit address bus.
3. It has 16-bit data bus.
4. It has multiplexed address/data bus.

2 Define Pipeline.

Pipeline is a technique used in microprocessors where the


processor begins executing a second instruction before the first
instruction is completed, in order to improve the overall speed
of instruction execution.

3 List 16-bit registers of 8086.

The 16-bit registers of 8086 microprocessor are:


1. AX (Accumulator)
2. BX (Base)
3. CX (Counter)
4. DX (Data)
4 State the function of following pins of 8086.
(a) TEST (b) BHE

The function of the following pins of 8086 are:


(a) TEST: Used for testing the microprocessor.
(b) BHE: Bus High Enable, used to enable the higher byte of the
data bus during a memory transfer.

5 State the function of following pins of 8086.


(a) ALE (b) DT/R

The function of the following pins of 8086 are:


(a) ALE: Address Latch Enable, used to latch the address into
the external latch.
(b) DT/R: Data Transmit/Receive, used to indicate the direction
of data transfer.

4 Marks

1 Draw the pin diagram of 8086.

2 Draw architecture of 8086 and Label it.

3 Write any four important functions of BIU.

The four important functions of the Bus Interface Unit (BIU) in


the 8086 microprocessor are:
1. Instruction Fetching: The BIU is responsible for fetching
instructions from the memory to the instruction queue, allowing
the Execution Unit (EU) to execute them.

2. Address Calculation: It calculates the physical addresses of


operands and instructions in memory by combining the segment
registers with the instruction pointer and other registers.

3. Data Transfer: The BIU handles the transfer of data between


the microprocessor and memory or I/O devices.

4. Queue Management: It contains an instruction queue that


allows the 8086 to prefetch instructions, which helps in
speeding up the execution process by having the next
instructions ready for the EU.

4 Write any four important functions of EU.

The four important functions of the Execution Unit (EU) in the


8086 microprocessor are:

1. Instruction Decoding: The EU decodes the instructions fetched


by the BIU and generates the necessary control signals to
execute them.

2. Arithmetic and Logic Operations: It performs arithmetic and


logical operations such as addition, subtraction, AND, OR, etc.,
on the data fetched from memory or registers.

3. Control Transfer Operations: The EU handles control transfer


operations like jumps, calls, and returns, which are essential
for program flow control.
4. Flag Register Update: It updates the flag register based on
the result of arithmetic and logic operations, which is crucial
for conditional branching and decision-making in the program
flow.

5 Draw the flag register format of 8086 microprocessor.

The flag register format of the 8086 microprocessor is as


follows:
Flag Description
CF Carry Flag
PF Parity Flag
AF Auxiliary Carry Flag
ZF Zero Flag
SF Sign Flag
TF Trap Flag
IF Interrupt Enable Flag
DF Direction Flag
OF Overflow Flag

Each flag serves a specific purpose in controlling the operation


and flow of the processor.

6 What is memory segmentation? How it is done in 8086


microprocessor.

The memory segmentation in the 8086 microprocessor is a method


of dividing the memory into segments to overcome the limitations
of a 16-bit architecture. In the 8086 microprocessor, memory
segmentation is achieved by using segment registers and an
offset to generate a 20-bit physical address.

The process of memory segmentation in the 8086 microprocessor


involves the following steps:
1. **Segment Registers**: The 8086 microprocessor has four
segment registers: CS (Code Segment), DS (Data Segment), SS
(Stack Segment), and ES (Extra Segment). These segment registers
hold the base address of the segments.

2. **Offset Address**: The offset address is a 16-bit value that


is added to the base address held in the segment register to
generate a physical address.

3. **Physical Address Generation**: The physical address is


generated by combining the base address from the segment
register with the offset address. The resulting physical address
is used to access the memory.

By using memory segmentation, the 8086 microprocessor can access


a larger memory space than what is directly accessible with a
16-bit address.

7 Describe the physical address generation processor in 8086


microprocessor.

The physical address generation process in the 8086


microprocessor involves the following steps:

1. **Segmentation**: The segment registers (CS, DS, SS, ES) hold


the base addresses of different memory segments. When an
instruction is executed, the appropriate segment register is
selected to form the base address for the memory access.

2. **Offset Calculation**: The offset address is determined


based on the specific instruction being executed and the
addressing mode used. The offset is added to the base address
held in the segment register to form a logical address.

3. **Segment:Offset Combination**: The logical address, formed


by combining the segment base address and the offset, is used to
access the memory. This combination results in a 20-bit physical
address.

4. **Memory Access**: The physical address is used to access the


memory for fetching instructions or data, or for storing data.

This process allows the 8086 microprocessor to access a larger


memory space by using 20-bit physical addresses, which is
essential for handling larger amounts of data and instructions.

CHAPTER 2 : The Art of Assembly Language Programming (CO2) (8


Marks)

2 Marks

1 State the function of Editor.

The function of an Editor in the context of assembly language


programming is to provide a platform for writing, modifying, and
saving the assembly language code. It allows the programmer to
create and edit the source code before it is assembled into
machine code.

2 Describe following assembler directives.


(a) DD (b) STRUCT

The assembler directives are described as follows:


(a) DD: The DD directive is used to define and initialize
double-word (4 bytes) variables or constants in assembly
language.

(b) STRUCT: The STRUCT directive is used to define a structure


or record in assembly language, allowing the programmer to
create complex data types composed of multiple fields or
members.

3 Describe following assembler directives.


(a) EQU (b) EVEN

The EQU directive in assembly language is used to define a


symbolic constant or an equate. It allows the programmer to
assign a name to a numeric constant, making the code more
readable and easier to maintain.

The EVEN directive is used to align the next data item on an


even byte boundary. This ensures that the next data item starts
on an even memory address, which can be important for certain
types of data access and memory management.

4 Difference between Assembler Directive and Instructions.

Assembler Directive Instructions


Directs the assembler on how Executable operation codes for
to process the source code the CPU
Provides information to the Directly perform specific
assembler about data operations such as data
allocation, memory movement, arithmetic, logic,
organization, and program and control flow
structure
Examples include EQU, DD, Examples include MOV, ADD,
STRUCT, EVEN JMP, CALL
4 Marks

1 State the steps involved in program development.

The steps involved in program development in the context of


assembly language programming are as follows:

1. **Problem Analysis**: Understanding the requirements and


constraints of the problem to be solved using assembly language.

2. **Algorithm Design**: Developing an algorithm to solve the


problem, breaking it down into smaller steps that can be
implemented using assembly language instructions.

3. **Writing Code**: Using an editor, the programmer writes the


assembly language code based on the algorithm designed for the
problem.

4. **Assembling**: The assembly language code is assembled using


an assembler to generate the machine code or object code.

These steps are essential in the development of assembly


language programs and form the foundation for creating efficient
and effective solutions using low-level programming.

2 Explain Assembly language program development tools

In the context of assembly language program development, the


tools used are as follows:

1. **Text Editor**: A text editor is used to write and modify


the assembly language code. It provides features such as syntax
highlighting, line numbering, and search and replace
functionality.

2. **Assembler**: The assembler is a tool that translates the


assembly language code into machine code or object code that can
be executed by the microprocessor.

3. **Debugger**: A debugger is used to test and debug the


assembled code. It allows the programmer to step through the
code, set breakpoints, and inspect the state of the program
during execution.

4. **Linker**: The linker is used to combine the object code


generated by the assembler with any necessary library code to
create the final executable program.

These tools are essential for the development, testing, and


debugging of assembly language programs, enabling programmers to
create efficient and functional software for microprocessor-
based systems.

3 Describe Value Returning Attribute Directives.

Value Returning Attribute Directives in assembly language


programming are used to define and manipulate data types and
memory allocation. These directives provide information to the
assembler about the attributes of data and how it should be
handled during the assembly process.

Examples of Value Returning Attribute Directives include:

1. **DB (Define Byte)**: This directive is used to define and


initialize one or more byte-sized (8-bit) variables or
constants.
2. **DW (Define Word)**: It is used to define and initialize one
or more word-sized (16-bit) variables or constants.

3. **DD (Define Doubleword)**: This directive is used to define


and initialize double-word (32-bit) variables or constants.

4. **DQ (Define Quadword)**: It is used to define and initialize


quad-word (64-bit) variables or constants.

These directives play a crucial role in specifying the data


types and memory allocation for variables and constants in
assembly language programs, ensuring proper handling and
utilization of memory resources.

CHAPTER 3: Instruction Set of 8086 Microprocessor (CO3) (16


Marks)

2 Marks

1 State example of immediate addressing mode.

An example of immediate addressing mode in 8086 microprocessor


is:
MOV AX, 1234H
In this example, the immediate value 1234H is directly loaded
into the AX register using the MOV instruction, demonstrating
the immediate addressing mode.

2 Identify the addressing mode of the following instructions.


(a) MUL AL,BL (b) MOV DX,0040H
The addressing mode of the following instructions in 8086
microprocessor are:

(a) MUL AL, BL - This instruction uses the register addressing


mode, where the multiplication operation is performed between
the AL and BL registers.

(b) MOV DX, 0040H - This instruction uses the immediate


addressing mode, where the immediate value 0040H is moved into
the DX register.

3 Explain the following instruction of 8086


(a) XLAT (b) XCHG

The following instructions of 8086 microprocessor are explained


as:

(a) XLAT: This instruction is used for table look-up


translation. It translates a byte at the offset in the DS:BX
register using the contents of AL as an index.

(b) XCHG: This instruction is used to exchange the contents of


two registers or a register and a memory location. For example,
XCHG AX, BX exchanges the contents of AX and BX registers.

4 Explain the following instruction of 8086


(a) CALL (b) RET

The following instructions of 8086 microprocessor are explained


as:
(a) CALL: This instruction is used to call a procedure or
subroutine. It pushes the address of the next instruction onto
the stack and transfers control to the specified procedure.

(b) RET: This instruction is used to return from a procedure. It


pops the return address from the stack and transfers control
back to the calling routine.

4 Marks

1 Write the instruction format of 8086 microprocessor.

The instruction format of the 8086 microprocessor is as follows:

[Prefix] [Opcode] [ModR/M] [Displacement] [Immediate]

Where:
- **Prefix**: Optional prefix byte that can modify the behavior
of the instruction.
- **Opcode**: Specifies the operation to be performed.
- **ModR/M**: Modifies the behavior of the opcode and specifies
the operands.
- **Displacement**: Provides the displacement value for memory
operands.
- **Immediate**: Contains an immediate value used as an operand.

This format allows the 8086 microprocessor to execute a wide


range of instructions with different addressing modes and
operand types, providing flexibility and versatility in
programming.
2 Sate and explain any four addressing mode of 8086 with
example.

The addressing modes of the 8086 microprocessor are as follows:

1. **Immediate Addressing Mode**: In this mode, the operand is a


constant value or an immediate data. For example:
MOV AX, 1234H

2. **Register Addressing Mode**: The operand is located in a


register. For example:
ADD AX, BX

3. **Direct Addressing Mode**: The operand is located at a


specific memory address. For example:
MOV AL, [5000H]

4. **Indirect Addressing Mode**: The operand is located at the


memory address specified by a register or a memory location. For
example:
MOV AL, [BX]

These addressing modes provide flexibility in accessing data and


instructions, allowing for efficient and versatile programming
on the 8086 microprocessor.

3 With suitable example and explain following instruction.


(a) DAA (b) ADC
(c) MUL (d) AAM

The following instructions of 8086 microprocessor are explained


as:
(a) DAA (Decimal Adjust Accumulator): This instruction is used
to adjust the result of an addition operation in the AL register
to form a valid binary-coded decimal (BCD) number.

Example:
DAA

(b) ADC (Add with Carry): This instruction adds the source
operand and the carry flag to the destination operand and stores
the result in the destination operand.

Example:
ADC AX, BX

(c) MUL (Unsigned Multiply): This instruction multiplies an


unsigned byte or word by the AL register and stores the result
in AX (for byte) or DX:AX (for word).

Example:
MUL BX

(d) AAM (ASCII Adjust for Multiplication): This instruction is


used to adjust the result of a multiplication operation in the
AL register to form unpacked BCD digits.

Example:
AAM

These instructions provide essential arithmetic and


multiplication operations in the 8086 microprocessor,
contributing to its computational capabilities.
4 Explain any four logical instructions of 8086 microprocessor
with example.

The logical instructions of the 8086 microprocessor are as


follows:

1. **AND**: Performs a bitwise AND operation between the


operands and stores the result in the destination operand. For
example:
AND AX, BX

2. **OR**: Performs a bitwise OR operation between the operands


and stores the result in the destination operand. For example:
OR AL, 1100B

3. **XOR**: Performs a bitwise XOR operation between the


operands and stores the result in the destination operand. For
example:
XOR DL, 1010B

4. **NOT**: Performs a bitwise NOT operation on the operand,


inverting each bit. For example:
NOT CX

These logical instructions provide essential bitwise operations


for data manipulation and logical processing in the 8086
microprocessor.

5 List and explain any four string operation instruction.

The string operation instructions of the 8086 microprocessor are


as follows:
1. **MOVS (Move String)**: This instruction moves a byte or word
from the source address to the destination address and
automatically increments or decrements the source and
destination pointers.

2. **LODS (Load String)**: This instruction loads a byte or word


from the source address into the AL/AX register and
automatically increments or decrements the source pointer.

3. **STOS (Store String)**: This instruction stores a byte or


word from the AL/AX register into the destination address and
automatically increments or decrements the destination pointer.

4. **CMPS (Compare String)**: This instruction compares a byte


or word at the source address with the byte or word at the
destination address and automatically increments or decrements
the source and destination pointers.

These string operation instructions are particularly useful for


handling arrays, data blocks, and string manipulation in
assembly language programming on the 8086 microprocessor.

6 Write assembly language instructions of 8086 microprocessor to


(a) Divide the content of AX register by 50H
(b) Rotate the content of BX register by 4 bit toward left.

The assembly language instructions for the 8086 microprocessor


to perform the specified tasks are as follows:

(a) **Divide the content of AX register by 50H**:


MOV DX, 0 ; Clear the DX register
MOV CX, 50H ; Set the divisor to 50H
DIV CX ; Divide AX by CX, quotient in AX, remainder in DX
(b) **Rotate the content of BX register by 4 bits toward the
left**:
ROL BX, 4 ; Rotate the content of BX register by 4 bits toward
the left

These instructions demonstrate the division operation and the


left rotation operation on the specified registers using the
assembly language for the 8086 microprocessor.

You might also like