0% found this document useful (0 votes)
4 views28 pages

Micro Assighnment

The document discusses the 8086 microprocessor, detailing its instruction set, control instructions, addressing modes, and differences with the 8087 co-processor. It explains various instructions such as data transfer, arithmetic, logical, branch, and control instructions, as well as the addressing modes that define how operands are accessed. Additionally, it describes the functions of specific pins on the 8086 microprocessor, highlighting their roles in managing operations and synchronization with peripherals.

Uploaded by

amanuel
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)
4 views28 pages

Micro Assighnment

The document discusses the 8086 microprocessor, detailing its instruction set, control instructions, addressing modes, and differences with the 8087 co-processor. It explains various instructions such as data transfer, arithmetic, logical, branch, and control instructions, as well as the addressing modes that define how operands are accessed. Additionally, it describes the functions of specific pins on the 8086 microprocessor, highlighting their roles in managing operations and synchronization with peripherals.

Uploaded by

amanuel
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/ 28

ARBAMINCH UNIVERSITY INSTITUTE TECHINOLOGY

FACULTY OF COMPUTING AND SOFTWARE ENGINEERING


DEPARTMENT OF SOFTWARE
SECTION A
Microprocessor And Assembly Language GROUP ASSIGNMENT
NAME ID NO,
1 Negusie Ebisa NSR/751/15
2 Taye Teferi NSR/887/15
3 Neima Mohammed NSR752/15
4 Kedist Tadesse NSR/552/15
5 Sinishaw yohannes NSR/855/15
6 Yeneneh Amots NSR/991/15
7 Aynalem Darge NSR/132/15
8 Meklit Wondwosen NSR/629/15
9 Yonatan Shitaye NSR/1019/15
10 Ermias Getnet NSR/344/15

Submitted: Amnuale
SubmitionDate: 10/05/2017 EC
1 .List various Instructions of 8086 and write how they are working.

Introduction:

The 8086 microprocessor, introduced by Intel in 1978, is a 16-bit microprocessor that


marked a significant step forward in computing technology. It was designed to handle
more complex tasks compared to its predecessors and played a crucial role in the
development of personal computers. The 8086 architecture supports a rich instruction
set that allows programmers to perform a variety of operations, ranging from
arithmetic to data transfer, logical, control, and string manipulation operations. This
set of instructions forms the basis for programming on the 8086 microprocessor.

In this article, we will examine some of the key instructions of the 8086
microprocessor, explain their working, and provide insight into how they contribute to
the functionality of the system.

1. Data Transfer Instructions:

These instructions are used to move data between registers, memory, and I/O ports.

MOV: This is the most commonly used data transfer instruction. It moves data from a
source operand to a destination operand.

Example: MOV AX, 30H (Moves the hexadecimal value 30 into the AX register).

PUSH: This instruction places the content of a register or memory location onto the
stack.Example: PUSH AX (Pushes the content of the AX register onto the stack).

POP: This instruction removes the content from the stack and places it into a register
or memory location.Example: POP AX (Pops the top value from the stack into the
AX register).

XCHG: This instruction exchanges the contents of two operands.Example: XCHG


AX, BX (Exchanges the values of AX and BX registers).

2. Arithmetic Instructions:

These instructions perform arithmetic operations like addition, subtraction,


multiplication, and division.

ADD: This instruction adds two operands and stores the result in the destination
operand.Example: ADD AX, BX (Adds the value in BX to AX).

SUB: This subtracts the second operand from the first operand.Example: SUB AX,
BX (Subtracts BX from AX).

MUL: This performs an unsigned multiplication of the operand with the AX


register.Example: MUL BX (Multiplies the value in BX with AX).
DIV: This performs an unsigned division of AX by the operand.Example: DIV BX
(Divides AX by BX).

3. Logical Instructions:

These instructions perform bitwise logical operations.

AND: This performs a bitwise AND operation between two operands.Example: AND
AX, BX (Performs an AND operation between AX and BX).

OR: This performs a bitwise OR operation between two operands.Example: OR AX,


BX (Performs an OR operation between AX and BX).

XOR: This performs a bitwise XOR operation between two operands.Example: XOR
AX, BX (Performs an XOR operation between AX and BX).

OT: This performs a bitwise NOT operation (inverts the bits) on the operand.Example:
NOT AX (Inverts the bits of AX).

4. Branch Instructions:

These instructions control the flow of execution.

JMP: This instruction causes an unconditional jump to a specified location.Example:


JMP 2000H (Jumps to the address 2000H).

CALL: This instruction calls a procedure by pushing the address of the next
instruction onto the stack and jumping to the target address.Example: CALL 3000H
(Calls a subroutine at address 3000H).

RET: This instruction returns control from a procedure by popping the return address
from the stack.Example: RET (Returns from a subroutine).

JZ: This instruction performs a jump if the zero flag is set.Example: JZ 5000H
(Jumps to 5000H if the zero flag is set).

5. Control Instructions:

These instructions control the operation of the microprocessor.

NOP: This is a no-operation instruction. It is used to do nothing and continue


execution.Example: NOP (No operation).

HLT: This instruction halts the execution of the program.Example: HLT (Halts the
program).

CLC: This clears the carry flag.Example: CLC (Clears the carry flag).

STC: This sets the carry flag.Example: STC (Sets the carry flag).
Conclusion:

The 8086 microprocessor’s instruction set is a powerful and versatile feature that
allows for a wide range of operations to be performed. From moving data between
registers and memory to performing complex arithmetic and logic operations, the
8086 provides all the tools necessary for efficient programming. Additionally, the
microprocessor includes control and branching instructions that give programmers the
ability to manipulate the flow of execution, making it a flexible tool for software
development. By understanding these instructions, programmers can harness the full
potential of the 8086 and create more sophisticated and optimized applications.

2 Explain Various Control Instructions.

Introduction:

Control instructions in the 8086 microprocessor play a crucial role in managing the
execution flow of a program. These instructions directly impact the operation of the
microprocessor, either by controlling its internal flags or halting execution. While not
as frequently used as data transfer or arithmetic instructions, control instructions are
essential for tasks such as managing program flow, handling interrupts, and
controlling flags.In this article, we will explore the various control instructions
available in the 8086 microprocessor, explaining their purpose and functionality.

The 8086 microprocessor includes several control instructions that manage its
operations:

NOP (No Operation):


The NOP instruction does nothing; it simply advances the instruction pointer by one.
It is used for timing purposes or when a delay is needed without affecting the program
state.Example: NOP (No operation is performed, and the next instruction is executed).

HLT (Halt):
The HLT instruction halts the execution of the program. It stops the processor's
operation and typically requires a reset to resume program execution. This instruction
is often used at the end of a program or during an error state to stop further
execution.Example: HLT (Halts the program execution).

CLC (Clear Carry Flag):


The CLC instruction clears the carry flag (CF), which indicates the presence or
absence of a carry during arithmetic operations. Clearing the carry flag is often used
before performing operations that rely on a known state of the flag.Example: CLC
(Clears the carry flag).

STC (Set Carry Flag):


The STC instruction sets the carry flag, which is useful when performing operations
that require the carry flag to be set.Example: STC (Sets the carry flag).

CLI (Clear Interrupt Flag):


The CLI instruction clears the interrupt flag (IF), disabling interrupts. This prevents
the processor from responding to interrupts, allowing the program to execute without
interruption.Example: CLI (Disables interrupts).

STI (Set Interrupt Flag):


The STI instruction sets the interrupt flag (IF), enabling interrupts. This allows the
processor to respond to hardware or software interrupts.Example: STI (Enables
interrupts).

WAIT:
The WAIT instruction is used to pause the execution of the program until the
processor receives a signal indicating that the next operation can be performed. It is
typically used with external devices.Example: WAIT (Pauses execution until the
condition is met).

Conclusion:

Control instructions in the 8086 microprocessor are fundamental for managing the
execution flow, handling interrupts, and controlling processor flags. Instructions like
NOP, HLT, CLC, and STC enable fine control over the processor's behavior, ensuring
smooth execution of tasks and error management. While they are used less frequently
than other instruction types, control instructions are indispensable for managing the
internal state of the processor and program execution.

3 Explain various Addressing modes of 8086

Introduction:

Addressing modes in the 8086 microprocessor define how the operands (data) of an
instruction are accessed and specified. These modes are crucial because they
determine how the processor retrieves data from memory or registers. The 8086
supports multiple addressing modes, offering flexibility in programming by allowing
different ways to access data, whether directly in registers, through memory, or using
displacement techniques.In this article, we will discuss the various addressing modes
available in the 8086 microprocessor, explaining their purpose and how they
function.The 8086 microprocessor supports several addressing modes that define how
operands are accessed:

Immediate Addressing Mode: In this mode, the operand is specified directly in the
instruction itself, rather than being stored in a register or memory location. The value
is constant and used immediately.Example: MOV AX, 5 (The value 5 is moved
directly into the AX register).

Register Addressing Mode: The operand is located in a register. The instruction


directly refers to the register as the source or destination.Example: MOV BX, AX
(The value in the AX register is moved to the BX register).

Direct Addressing Mode: In this mode, the operand is located at a specific memory
address, which is provided in the instruction.Example: MOV AX, [2000H] (The value
stored at memory address 2000H is moved into AX).
Indirect Addressing Mode: The operand is accessed via a register that holds the
memory address of the operand. The effective address is computed by adding an
optional displacement to the value in the register.Example: MOV AX, [BX] (The
value at the memory address stored in the BX register is moved into AX).

Indexed Addressing Mode: This mode uses an index register (like SI or DI)
combined with a displacement to access memory. It is often used for accessing array
elements.Example: MOV AX, [SI+10H] (The value at the memory address formed by
adding 10H to the value in SI is moved into AX).

Based Addressing Mode: In this mode, the operand is accessed by adding a


displacement to the value stored in the base register (like BP or BX).Example: MOV
AX, [BX+20H] (The value at the address formed by adding 20H to the contents of the
BX register is moved into AX).

Based Indexed Addressing Mode: This mode combines both base and index
registers with an optional displacement. It is used to access data with complex
addressing needs, such as multidimensional arrays.Example: MOV AX, [BX+SI+10H]
(The value at the memory address formed by adding 10H to the sum of BX and SI is
moved into AX).

Conclusion:

Addressing modes in the 8086 microprocessor provide different ways to access data,
offering flexibility and efficiency in program design. By supporting immediate,
register, direct, indirect, indexed, based, and combined addressing modes, the 8086
allows programmers to optimize data access and memory usage. Understanding these
addressing modes is key to writing effective assembly code and maximizing the
potential of the microprocessor.

4 Write the difference between 8087 Intel-co processor and 8086


microprocessors.

Introduction:

The Intel 8086 microprocessor and the 8087 co-processor are key components in the
evolution of computer architecture, designed by Intel in the late 1970s and early
1980s. While the 8086 is a general-purpose microprocessor, the 8087 is a specialized
co-processor designed to assist the 8086 with advanced mathematical calculations,
particularly floating-point operations. The following sections will highlight the main
differences between these two processors, focusing on their functions, capabilities,
and roles in a computing system.

Functionality:

Intel 8086 Microprocessor: The 8086 is a 16-bit general-purpose microprocessor,


primarily designed for executing instructions in a system’s central processing unit
(CPU). It is capable of handling a variety of tasks, including arithmetic, logic, and
data transfer operations, within the constraints of its architecture. The 8086 can
address up to 1 MB of memory and operates at clock speeds ranging from 5 to 10
MHz, depending on the variant.

Intel 8087 Co-processor: The 8087, on the other hand, is a floating-point arithmetic
co-processor that supplements the 8086 by offloading complex mathematical
calculations, such as multiplication, division, square roots, and trigonometric
functions. It does not function as a standalone processor and cannot execute general-
purpose instructions. The 8087 enhances the 8086's computational power, especially
in applications requiring intensive floating-point arithmetic, such as scientific
computing and engineering applications.

Data Processing:

8086: The 8086 is limited to integer operations, processing 16-bit data at a time. Its
computational tasks involve fixed-point arithmetic, which is useful for many general
applications but inefficient for scientific computations that demand floating-point
precision.

8087: The 8087, in contrast, is optimized for floating-point arithmetic. It handles 32-
bit single-precision and 64-bit double-precision floating-point numbers, offering
significantly improved performance in mathematical tasks that require such
operations.

Integration and Usage:

8086: As a stand-alone processor, the 8086 executes all the program instructions in a
system, handling both control and computational tasks. It was widely used in early
personal computers like the IBM PC.

8087: The 8087 works in tandem with the 8086, providing additional computational
support. It operates as a companion chip and communicates with the 8086 through a
dedicated bus. The 8087 was not essential for the operation of the system but
significantly boosted performance in applications that made use of its capabilities.

Performance:

8086: The 8086 is more efficient for general-purpose processing tasks, but its
performance diminishes when dealing with floating-point calculations.

8087: The 8087 significantly accelerates floating-point operations by executing them


in hardware rather than software, providing faster results compared to the 8086, which
would otherwise require software routines for floating-point arithmetic.

Conclusion:

In conclusion, while both the 8086 microprocessor and the 8087 co-processor were
crucial in the development of computing technology, their roles differ significantly.
The 8086 is a versatile, general-purpose processor used for executing most computer
programs, whereas the 8087 serves as a dedicated assistant to the 8086, enhancing its
capability to handle complex floating-point calculations efficiently. By working
together, the two processors enabled more powerful and specialized computing,
particularly in applications that demanded high computational precision.

5 What are the function of Ready, ALE, HOLD, and RESET


pins of 8086 microprocessor?
The 8086 microprocessor has several control and status pins that play crucial roles in
its operation. Here are the functions of the specific pins:
1. READY (RDY):
The READY pin is used to indicate whether the 8086 is ready to proceed with the
next operation. It is an input pin that allows the microprocessor to synchronize with
slower peripherals or memory devices. When READY is low, the 8086 will wait and
hold its operations until READY goes high, indicating that the peripheral is ready for
data transfer. The Ready pin indicates if the microprocessor is ready to receive data.
The READY (RDY) pin in the 8086 microprocessor is a crucial control pin that is
used to manage the flow of data between the microprocessor and slower peripheral
devices or memory. Its primary function is to indicate whether the microprocessor is
ready to proceed with its operations or if it needs to wait for a slower device to
become ready.
▎Functionality of the READY Pin
1. Input Signal: The READY pin is an input to the 8086 microprocessor. It informs
the processor whether it can continue executing instructions or if it must wait.
2. Wait States: When the READY pin is low (logic 0), it signals the 8086 that the
device it is communicating with is not ready to complete the data transfer. In this case,
the microprocessor will enter a wait state, effectively pausing its operation until the
READY pin goes high (logic 1), indicating that the device is ready.
3. Synchronization: This mechanism allows the 8086 to synchronize its operation with
slower devices, ensuring that data integrity is maintained during communication.
▎Examples of Usage
1. Memory Access:
• Suppose the 8086 is accessing a slow RAM chip that takes longer than usual to
respond. If the RAM chip needs more time to prepare the data, it can keep the
READY pin low until it is ready. The microprocessor will then halt execution of
further instructions, waiting for the RAM to become ready.
• For example, if the 8086 tries to read data from RAM, and the RAM takes 3 clock
cycles to respond, it can hold the READY pin low for those cycles. Once the RAM is
ready, it sets the READY pin high, and the microprocessor can continue with its
operation.
Peripheral Devices:
Consider a scenario where the 8086 is communicating with a slow peripheral device,
such as a printer or an older I/O device. If the device cannot process data as quickly as
the microprocessor sends it, it can assert a low signal on the READY pin.
For instance, if the 8086 sends a command to print data and the printer needs
additional time to process this command, it can hold the READY line low until it’s
ready to accept more data. The microprocessor will wait until it receives a high signal
on READY before sending more data.
2. ALE (Address Latch Enable):
The ALE pin is used to demarcate the valid address on the address/data bus. When
ALE is high, it indicates that the address on the bus is valid and should be latched by
external circuits, such as address latches. This is particularly important because the
8086 uses a multiplexed bus for both addresses and data, meaning that it shares the
same physical lines for both types of information. The Address Latch Enable pin
allows the 8086 to access memory and peripheral devices.
The ALE (Address Latch Enable) pin in the 8086 microprocessor is a crucial control
signal used to manage the separation of address and data buses during operations.
This pin plays a vital role in systems where multiplexed address and data buses are
utilized.
▎Functionality of the ALE Pin
1. Address Latch Control: The ALE pin is used to indicate when the address bus
contains a valid address. When ALE is asserted (set high), it signals external circuitry
(like an address latch) to capture the address present on the address/data bus.
2. Multiplexed Buses: In the 8086 architecture, the address and data lines are
multiplexed, meaning that the same physical lines are used for both addresses and
data at different times. The lower 16 bits of the address bus (A0-A15) are shared with
the data bus (D0-D15). The ALE signal allows external components to differentiate
between when the bus carries an address versus when it carries data.
3. Timing: The ALE signal is typically asserted during the first part of a bus cycle
when the address is stable. It remains high for a short period to allow external latches
to capture the address before the bus switches to data transmission.
▎Examples of Usage
1. Memory Access:
When the 8086 wants to read from or write to memory, it first places the memory
address on the address/data bus during the initial clock cycles. The ALE pin is then
set high, indicating that the value on the bus is a valid address.
• For example, if the 8086 intends to read data from memory location 0x1234, it
will output this address on the multiplexed bus and assert ALE high. External
circuitry can then latch this address into an address latch, ensuring it is stored
correctly before the bus switches to transmit data.
2. I/O Operations: Similar to memory access, when communicating with I/O devices,
the 8086 will place an I/O port address on the multiplexed bus. When ALE is high,
external devices can latch this address for later use.
For instance, if the microprocessor needs to send a command to an I/O device at port
0x01, it will place this address on the bus and assert ALE high. The I/O device can
then read and store this address while preparing to receive or send data.

3. HOLD:
The HOLD pin is used to request control of the bus from the 8086. When another
device (like a DMA controller) wants to take control of the system bus, it asserts the
HOLD signal. The 8086 will then complete its current instruction and release control
of the bus once it acknowledges the request by asserting the HLDA (Hold
Acknowledge) signal. The Hold pin allows an external device to temporarily control
the system bus. The processor responds by issuing a hold acknowledge signal on the
HLDA pin.
The HOLD pin in the 8086 microprocessor is a control signal used for bus arbitration
in multiprocessor and peripheral systems. It allows an external device to request
control of the system bus, enabling it to perform operations such as reading or writing
data.
▎Functionality of the HOLD Pin
1. Bus Request: The HOLD pin is used by an external device (like a DMA controller
or another processor) to request control of the address and data buses from the 8086
microprocessor. When an external device wants to take control, it asserts the HOLD
signal (sets it high).
2. Bus Release: Upon receiving the HOLD signal, the 8086 microprocessor will
complete its current bus cycle and then relinquish control of the bus. The
microprocessor will then enter a state where it allows the requesting device to use the
bus for its operations.
3. Control Signal: The 8086 uses the HLDA (Hold Acknowledge) pin to acknowledge
the HOLD request. When the microprocessor is ready to release the bus, it sets HLDA
high, indicating to the requesting device that it can take control.
▎Examples of Usage
1. Direct Memory Access (DMA): In systems that use DMA controllers, the DMA
controller may need to transfer data directly between memory and an I/O device
without involving the CPU.
For instance, when a DMA operation is initiated, the DMA controller will assert the
HOLD pin to request control of the bus. The 8086 will finish its current instruction
and then release the bus.
Once the bus is released, the DMA controller can read data from memory or write
data to memory directly, bypassing the CPU.
2. Multiprocessor Systems:
In systems with multiple processors (like a dual-processor setup), one processor might
need to temporarily relinquish control of the bus for another processor to execute its
tasks.
For example, if Processor A is currently executing instructions but Processor B needs
to access shared memory, Processor B can assert HOLD. The 8086 will complete its
current operation and assert HLDA, allowing Processor B to take control of the bus
and perform its operations.
4. DEN (Data Enable):
The DEN pin is used to indicate when valid data is present on the data bus. It is an
output pin that becomes active when data is being transferred either to or from
memory or I/O devices. This signal helps external devices know when they should
read from or write to the data bus.
The DEN (Data Enable) pin in the 8086 microprocessor is a control signal used to
manage data transfer during read and write operations. It indicates when the data bus
is valid and can be used to read or write data.
▎Functionality of the DEN Pin
1. Data Transfer Control: The DEN pin is activated (set to high) during the data
transfer phase of a read or write operation. When DEN is high, it signals that the data
on the data bus is valid and can be read by an external device or written to memory.
2. Read and Write Operations: Read Operation: During a read operation, the 8086
activates the DEN pin to indicate that the data on the data bus can be read by the
requesting device (like memory or an I/O port).
Write Operation: In a write operation, the DEN pin is also activated to indicate that
the data being sent from the microprocessor to memory or an I/O device is valid.
▎Examples of Usage
1. Reading Data from Memory:
When the 8086 microprocessor needs to read data from memory, it places the address
of the memory location on the address bus and activates the DEN pin.For example, if
the microprocessor wants to read a byte of data from memory location 0x1234, it will
output this address on the address bus, assert the DEN pin, and then wait for the
memory to place the data on the data bus. Once the data is available, it can be read by
the microprocessor.
2. Writing Data to an I/O Device: When writing data to an I/O device, the 8086 places
the address of the I/O device on the address bus and the data to be sent on the data bus.
The DEN pin is asserted during this operation to indicate that the data on the data bus
is valid and should be written to the specified I/O port.
For example, if the microprocessor wants to send a byte of data 0xAB to an output
device at I/O port 0x01, it will output the port address on the address bus, place 0xAB
on the data bus, and assert DEN to signal that this data is valid for writing.
5. RESET
The RESET pin is used to initialize the microprocessor. When this pin is activated
(pulled low), it clears the internal registers and sets the program counter to a
predefined start address (typically 0xFFFF0). This effectively resets the
microprocessor, allowing it to start executing instructions from a known state.
The Reset pin resets the microprocessor if it is held high for at least four clocking
periods. When the microprocessor resets, it starts executing instructions at memory
location FFFFOH.
The RESET pin in the 8086 microprocessor is a control signal used to initialize the
microprocessor. When activated, it forces the microprocessor to terminate its current
operations and reset its internal state, including the program counter and other
registers.
▎Functionality of the RESET Pin
1. Initialization: The RESET pin, when asserted (typically by applying a high signal),
clears the internal registers and sets the program counter to a predefined address,
usually FFFF0h. This address corresponds to the start of the BIOS or firmware in a
typical system.
2. Interrupt Handling: The RESET pin can also be used to handle situations where the
system needs to recover from an error or fault condition. By resetting the
microprocessor, it can return to a known state.
3. Control Signal: The RESET pin is an active-high signal, meaning that it must be
driven high to trigger the reset condition.
▎Behavior Upon Reset
When the RESET pin is activated:
The 8086 microprocessor clears all internal registers.
The Instruction Pointer (IP) is set to 0000h, and the Code Segment (CS) is set to
FFFFh, directing the processor to start execution from address FFFF0h.
All flags in the FLAGS register are reset.
▎Examples of Usage
1. System Boot-Up: When a computer is powered on, the RESET pin is typically
asserted to ensure that the microprocessor starts in a known state. This initialization
process allows the BIOS to execute and perform hardware checks before loading the
operating system.
For instance, when you turn on your PC, the power-on reset circuit asserts the RESET
pin, causing the 8086 to begin execution from the BIOS at memory address FFFF0h.
2. Error Recovery:
In a scenario where a program causes an infinite loop or crashes due to an error, a
hardware reset button may be pressed. This action asserts the RESET pin, forcing the
microprocessor to stop executing the faulty program and return to its initial state.
For example, if a user encounters a non-responsive application, pressing the reset
button will clear all current operations and restart the system, allowing it to run
normally again.
3. Development and Debugging:
During development or debugging, engineers may use the RESET pin to quickly
restart the microprocessor without needing to power cycle the entire system. This
allows for rapid testing of changes in code or hardware configurations.
In Summary, These pins are essential for managing communication between the 8086
microprocessor and other components in a computer system, ensuring proper
synchronization and control during operations.

6 Discuss the 80X86 family of CPU’s


Introduction
The 80x86 family of CPUs, developed by Intel, is one of the most influential
microprocessor architectures in the history of computing. It encompasses a range of
processors that began with the 8086, introduced in 1978, and evolved through
numerous generations. These processors have formed the backbone of personal
computing, embedded systems, and server technology.

Historical Development
The journey of the 80x86 family began with the 8086 processor, which was Intel's
first 16-bit microprocessor. This processor introduced significant advancements over
its predecessors, including a 20-bit address bus, enabling access to 1 MB of memory.
The subsequent release of the 8088 processor, with its 8-bit external data bus, made it
a cost-effective option for personal computers, notably the IBM PC. These early
processors paved the way for widespread adoption of the x86 architecture.

Architectural Features
The 80x86 architecture is based on Complex Instruction Set Computing (CISC),
which allows for a wide range of instructions and addressing modes. Key features
include segmented memory, general-purpose registers, and support for real-mode and
protected-mode operations. The segmented memory model, while initially complex,
allowed the processors to address more memory than their 16-bit design would
otherwise permit.

Evolution Through Generations


The 80x86 family evolved significantly over the decades, each generation introducing
new features and capabilities. The 80286 brought protected mode, enabling advanced
memory management and multitasking. The 80386 introduced 32-bit architecture and
virtual memory support, making it a critical milestone. The 80486 integrated a
floating-point unit and enhanced cache memory, improving performance.
The Pentium series marked another leap, featuring superscalar architecture that
allowed multiple instructions to be processed simultaneously. Later models, such as
the Pentium Pro, Pentium II, and Pentium III, further improved performance with
features like dynamic execution and multimedia extensions.

Impact on Personal Computing


The 80x86 processors have played a pivotal role in the development of personal
computing. Their inclusion in IBM PCs and subsequent clones created a standard
platform for software development. This compatibility ensured that software written
for earlier processors could run on newer ones, fostering a robust ecosystem of
applications.

Server and Embedded Systems


Beyond personal computing, the 80x86 architecture has been widely used in servers
and embedded systems. Its scalability and performance make it suitable for handling
enterprise-level workloads, while its adaptability has enabled its use in various
embedded applications, from industrial automation to consumer electronics.

Modern Developments
In recent years, the x86 architecture, derived from the 80x86 family, has continued to
dominate the computing landscape. Modern processors feature advanced technologies
such as multi-core architectures, hyper-threading, and integrated graphics. The
introduction of 64-bit extensions has further expanded the capabilities of the
architecture, allowing it to address vast amounts of memory.

Competitive Landscape
Despite its dominance, the 80x86 family has faced competition from other
architectures such as ARM and RISC-V. These architectures are known for their
energy efficiency and simplicity, making them popular in mobile devices and low-
power applications. However, the x86 architecture remains a preferred choice for
performance-intensive tasks.

Challenges and Criticisms


The 80x86 architecture has also faced criticism for its complexity and power
consumption compared to other designs. Its reliance on backward compatibility has
led to compromises in architectural efficiency. Nonetheless, its longevity and
adaptability have ensured its continued relevance.
Legacy and Conclusion
The 80x86 family of CPUs has left an indelible mark on the computing industry. Its
introduction revolutionized personal computing, and its evolution has kept pace with
the demands of modern technology. The architecture's influence extends beyond
hardware, shaping software development and standards. As the foundation of the x86
architecture, the 80x86 family continues to be a cornerstone of computing innovation.

7 Compare 8085, 8086 and 8088 microprocessors with each other.


Here’s comparison of the 8085, 8086, and 8088 microprocessors across multiple
dimensions:
1. Architecture
8085
- Type: 8-bit microprocessor.
- Address Bus: 16-bit, allowing access to 64 KB of memory.
- Data Bus: 8-bit.
- Registers:
- 6 general-purpose registers (B, C, D, E, H, L).
- 1 Accumulator.
- 1 Flag register.
- Instruction Set: Basic and limited, with around 74 instructions.
8086
- Type: 16-bit microprocessor.
- Address Bus: 20-bit, allowing access to 1 MB of memory.
- Data Bus: 16-bit.
- Registers:
- 8 general-purpose registers (AX, BX, CX, DX).
- Segment registers (CS, DS, SS, ES) for memory segmentation.
- 1 Instruction pointer and 1 Flag register.
- Instruction Set**: More complex with around 117 instructions, supporting advanced
operations.
8088
- Type: 16-bit microprocessor.
- Address Bus: 20-bit, similar to 8086, allowing access to 1 MB of memory.
- Data Bus: 8-bit.
- Registers: Same as 8086, with 8 general-purpose registers and segment registers.
- Instruction Set: Similar to the 8086 but optimized for 8-bit data.
2. Data and Address Bus
- 8085:
- Data Bus: 8-bit, meaning it can transfer 1 byte of data at a time.
- Address Bus: 16-bit enables it to address memory locations directly.
- 8086:
- Data Bus: 16-bit, allowing more efficient data handling by processing 2 bytes at a
time.
- Address Bus: 20-bit, which can address 2^20 = 1,048,576 memory locations (1
MB).
- 8088:
- Data Bus: 8-bit, which can lead to lower data throughput compared to the 8086.
- Address Bus: 20-bit, same as 8086, allowing access to the same amount of memory.
3. Performance
- Clock Speed:
- 8085: Typically operates at 3 MHz.
- 8086: Operates between 5 MHz and 10 MHz or higher in some variants.
- 8088: Similar clock speeds as the 8086, around 4.77 MHz in early models.
- Instruction Execution:
- 8085: Executes fewer instructions and has a simpler execution model.
- 8086: Can execute more complex instructions more quickly due to its 16-bit
architecture.
- 8088: Performance is limited by its 8-bit data bus, making it less efficient than the
8086.
4. Memory Management
- 8085:
- Does not support memory management features like segmentation.
- Simple flat memory model.
- 8086:
- Introduces memory segmentation, which divides memory into segments (code, data,
stack, extra).
- More efficient memory usage and organization.
- 8088:
- Also supports memory segmentation similar to 8086.
- Compatible with 8-bit systems, which could limit some applications.
5. Instruction Set and Addressing Modes
- 8085:
- Limited addressing modes: immediate, direct, register, and register indirect.
- Instructions are straightforward, mostly arithmetic and logical operations.
- 8086:
- Richer instruction set with multiple addressing modes, including indexed, based,
and relative addressing.
- Supports complex data types and operations.
- 8088:
- Similar instruction set to the 8086, but optimized for performance with 8-bit data
operations.
- Includes additional instructions for 8-bit data handling.
6. Applications
- 8085:
- Used in simple embedded systems, educational purposes, and basic computing tasks.
- Suitable for control applications.
- 8086:
- Widely used in early personal computers, particularly in IBM PC and compatible
systems.
- Suitable for more demanding applications due to its performance.
- 8088:
- Also used in IBM PC, particularly in the original models.
- Its design helped bridge the gap between 8-bit and 16-bit computing.
7. Multitasking and Protection
- 8085:
- Does not support multitasking or memory protection features.
- 8086 and 8088:
- Support multitasking through software and operating systems.
- Introduced concepts of memory protection and segmentation, which laid the
foundation for future processors.
Conclusion
- 8085 is best for basic applications where simplicity and low cost are key.
- 8086 offers a significant advancement in processing power, memory handling, and
suitable applications for more complex computing tasks.
- 8088 provides a practical compromise, making it accessible for 8-bit systems while
retaining the advantages of a 16-bit architecture.

8 What do you mean interrupt in hardware and software? And List


the types of hardware interrupt and software in 8086.

Introduction:

An interrupt is a mechanism that allows a computer to respond to specific events or


conditions, either from external hardware devices or internal software processes, by
temporarily halting the current execution and transferring control to an interrupt
handler. Interrupts are essential for real-time processing, enabling efficient
multitasking and quick responses to events. Interrupts in the 8086 microprocessor are
categorized into hardware interrupts and software interrupts. This distinction
highlights the source of the interrupt and its handling method.

Hardware Interrupts:

Hardware interrupts are initiated by external devices, such as I/O devices or


peripherals, to notify the processor about an event or condition that requires
immediate attention. These interrupts allow devices to signal the CPU without having
to wait for the CPU to regularly check for events, improving system efficiency.

Types of Hardware Interrupts in 8086:

INT 0: The lowest priority interrupt. It is typically reserved for system-level


events.

INT 1 (Keyboard Interrupt): Triggered by a keyboard event (such as a keypress).


This is often used by the keyboard interface.

INT 2: Cascaded interrupt used for the 8259 Programmable Interrupt Controller
(PIC) for managing hardware interrupt requests.

INT 3 (Breakpoint Interrupt): Used for debugging purposes. It causes the


processor to halt and enter debugging mode.
INT 4-7: These interrupts are used by hardware devices (e.g., disk drives, timers,
and printers). Each has its specific function, such as handling I/O operations,
system time intervals, etc.

Hardware interrupts are asynchronous, meaning that they can occur at any time during
the execution of a program.

Software Interrupts:

Software interrupts are initiated by software instructions rather than external hardware
devices. These interrupts are used to trigger specific system services or functions,
often to communicate with the operating system or to invoke system-level operations.
Software interrupts are usually intentionally invoked by the program to request
services such as input/output operations, system calls, or error handling.

Types of Software Interrupts in 8086:

INT n (Software Interrupt Instruction): The general format for invoking a


software interrupt. It is used by a program to request specific services from the
operating system or the BIOS. The value of n indicates the interrupt vector.

INT 21h: A commonly used interrupt in DOS-based systems for performing


system services like reading from or writing to a file, displaying characters on the
screen, or exiting a program.

INT 10h: Used for video-related services, such as changing screen modes or
displaying text and graphics.

INT 13h: Used for disk operations such as reading and writing sectors on disk
drives.

INT 20h: Terminates the program and returns control to the operating system.

Software interrupts are synchronous, meaning they are initiated during the normal
execution of a program and typically used for invoking system-level functions or error
handling.

Conclusion:

In summary, interrupts in the 8086 microprocessor are essential for managing


efficient and responsive execution in a system. Hardware interrupts, initiated by
external devices, allow the CPU to respond to real-time events, while software
interrupts, initiated by software instructions, enable the program to request system
services. Both types of interrupts play a critical role in ensuring the timely handling of
tasks and facilitating smooth multitasking in computing environments.

9: The Purposes of Using Directives in 8086 Assembly Language


Directives in assembly language are commands that guide the assembler during the
assembly process. They do not produce executable instructions but provide essential
information about the structure and flow of the program. The main purposes of using
directives are:
1. Program Organization: Directives like `.MODEL`, `.DATA`, and `.CODE` help define
program structure, separating data, code, and stack segments.
2. Memory Management: Directives such as `DB`, `DW`, and `DD` reserve memory for
variables and constants.
3. Control Flow: Conditional assembly directives like `IF`, `ELSE`, and `ENDIF` allow
creating parts of code that are assembled only under certain conditions.
4. Debugging and Labeling: Directives such as `EQU` assign constant values to identifiers,
making the code more readable and maintainable.
5. Macros and Reusability: Using `MACRO` and `ENDM` directives, repetitive code can
be reused without rewriting it, improving efficiency.

Examples of Directives:
.MODEL: Specifies the memory model (e.g., `.MODEL SMALL`).
.DATA: Declares the data segment where variables are stored.
.DATA
VAR1 DB 10 ; Declares a variable VAR1 with value 10
.CODE: Marks the beginning of the code segment.
EQU: Defines a constant value.
MAXIMUM EQU 100 ; MAXIMUM is now a constant with value 100
MACRO: Defines a reusable block of code.
PRINT MACRO MSG
MOV AH, 09H
LEA DX, MSG
INT 21H
ENDM
In conclusion, directives are vital in 8086 programming for efficient code
organization, memory management, and readability. Their proper use ensures the
program is structured, maintainable, and easily understandable.
10 Explain the difference between immediate and indirect operand instructions.
What is Operand ?

Operand is the part of a computer instruction which specifies what data is to be


manipulated or operated on, while at the same time representing the data itself.It is a
part of the instruction that contains the data to be acted on.
What is Instruction ?
An instruction is a binary pattern designed inside a microprocessor to perform a
specific function. It is actually a command to the microprocessor to perform a given
task on specified data.The entire group of instructions that a microprocessor supports
is called Instruction Set.
Immediate Operand Instruction
Immediate Operands
immediate operand in computer science refers to a data value encoded within an
instruction itself, used for operations like loading registers.
Some instructions use data encoded in the instruction itself as a source operand. The
operands are called immediate operands. For example, the following instruction loads
the EAX register with zero.
MOV EAX, 00
The maximum value of an immediate operand varies among instructions, but it can
never be greater than 2^32.

Constants/Immediates
Load word and store word, lw and sw, also illustrate the use of constants in MIPS
instructions. These constants are called immediates, because their values are
immediately available from the instruction and do not require a register or memory
access. Add immediate, addi, is another common MIPS instruction that uses an
immediate operand. addi adds the immediate specified in the instruction to a value in
a register.
Example
Immediate Operands
High-Level Code
a = a + 4;
b = a − 12;
MIPS Assembly Code
# $s0 = a, $s1 = b
addi $s0, $s0, 4 # a = a + 4
addi $s1, $s0, −12 # b = a − 12

Indirect Operand Instruction


It is a type of addressing mode where the actual address of the operand is not directly
specified in the instruction, but instead, the instruction specifies the address of a
memory location that contains the actual address of the operand.It is a computer
instruction that uses an indirect addressing mode to access data in memory. The
instruction specifies the address of a value that points to the operand's effective
address.
In indirect addressing mode, the address field in the instruction points to the memory
location or register where the effective address of the operand is present.
Two memory accesses are required. One to get the value stored at the given address
field. Second to get the effective address of operand at the address found. It can be
further classified as Register Indirect addressing and Memory Indirect Addressing.
Example: Add the contents of the address stored at register B.
ADD [B]
In the address field of the instruction, here register B holds the address of the operand.

Difference between Immediate and indirect operand instruction


Address Field
In indirect operand instruction, the address field of the instruction holds the address of
the operand.
In immediate oprands, there is no address field as the operand is a part of the
instruction. It has an operand field instead of an address field.
Memory Reference
Indirect operand instruction requires two references to memory.
Immediate operands does not require any reference to memory for fetching data.
Process Speed
In indirect operand instruction, speed is slower compared to the immediate mode.
In immediate oprands, speed is a faster process.
Range
In indirect operand instruction, has more range than in immediate mode.
In immediate oprands, has a limited range.
10 Explain the difference between immediate and indirect operand instructions.
What is Operand ?
Operand is the part of a computer instruction which specifies what data is to be
manipulated or operated on, while at the same time representing the data itself.It is a
part of the instruction that contains the data to be acted on.
What is Instruction ?
An instruction is a binary pattern designed inside a microprocessor to perform a
specific function. It is actually a command to the microprocessor to perform a given
task on specified data.The entire group of instructions that a microprocessor supports
is called Instruction Set.
Immediate Operand Instruction
Immediate Operands
immediate operand in computer science refers to a data value encoded within an
instruction itself, used for operations like loading registers.
Some instructions use data encoded in the instruction itself as a source operand. The
operands are called immediate operands. For example, the following instruction loads
the EAX register with zero.
MOV EAX, 00
The maximum value of an immediate operand varies among instructions, but it can
never be greater than 2^32.

Constants/Immediates
Load word and store word, lw and sw, also illustrate the use of constants in MIPS
instructions. These constants are called immediates, because their values are
immediately available from the instruction and do not require a register or memory
access. Add immediate, addi, is another common MIPS instruction that uses an
immediate operand. addi adds the immediate specified in the instruction to a value in
a register.
Example
Immediate Operands
High-Level Code
a = a + 4;
b = a − 12;
MIPS Assembly Code
# $s0 = a, $s1 = b
addi $s0, $s0, 4 # a = a + 4
addi $s1, $s0, −12 # b = a − 12

Indirect Operand Instruction


It is a type of addressing mode where the actual address of the operand is not directly
specified in the instruction, but instead, the instruction specifies the address of a
memory location that contains the actual address of the operand.It is a computer
instruction that uses an indirect addressing mode to access data in memory. The
instruction specifies the address of a value that points to the operand's effective
address.
In indirect addressing mode, the address field in the instruction points to the memory
location or register where the effective address of the operand is present.
Two memory accesses are required. One to get the value stored at the given address
field. Second to get the effective address of operand at the address found. It can be
further classified as Register Indirect addressing and Memory Indirect Addressing.
Example: Add the contents of the address stored at register B.
ADD [B]
In the address field of the instruction, here register B holds the address of the operand.

Difference between Immediate and indirect operand instruction


Address Field
In indirect operand instruction, the address field of the instruction holds the address of
the operand.
In immediate oprands, there is no address field as the operand is a part of the
instruction. It has an operand field instead of an address field.
Memory Reference
Indirect operand instruction requires two references to memory.
Immediate operands does not require any reference to memory for fetching data.
Process Speed
In indirect operand instruction, speed is slower compared to the immediate mode.
In immediate oprands, speed is a faster process.
Range
In indirect operand instruction, has more range than in immediate mode.
In immediate oprands, has a limited range.

11 How do the following parameter passing mechanisms work?


Pass by value
Pass by reference
Pass by value-returned
Pass by name

Introduction:

Parameter passing is a technique used in programming to pass data to functions or


procedures. The way data is passed influences how changes made within a function
affect the original variables or data. There are several parameter passing mechanisms
used in different programming languages, including pass by value, pass by reference,
pass by value-returned, and pass by name. Each mechanism behaves differently in
terms of how arguments are handled and how the function or procedure interacts with
them.

a) Pass by Value:

In the pass by value mechanism, the actual value of the argument is passed to the
function or procedure. This means that a copy of the argument is created and used
within the function. Any changes made to the parameter inside the function do not
affect the original argument in the calling environment.

Example: If a function modifies a parameter, it only modifies the local copy, leaving
the original argument unchanged.

For example:

c
Copy
void addTen(int x) {
x = x + 10; // Modifies the copy of the argument
}
int main() {
int a = 5;
addTen(a);
// 'a' remains 5, as only the copy of 'a' was modified.
}

b) Pass by Reference:

In pass by reference, the address (or reference) of the argument is passed to the
function, not the actual value. This means that the function operates directly on the
argument in the calling environment. Any changes made to the parameter inside the
function will affect the original argument.
Example: When using pass by reference, changes made to the parameter will be
reflected in the original argument because the function works with the memory
location of the argument.

For example:

c
Copy
void addTen(int &x) {
x = x + 10; // Modifies the original argument directly
}
int main() {
int a = 5;
addTen(a);
// 'a' becomes 15, as the original variable is modified.
}

c) Pass by Value-Returned:

In pass by value-returned, the argument is passed by value to the function, and any
changes made to the parameter inside the function are not reflected in the original
variable. However, the function returns the modified value, which can then be
assigned back to the original variable.

Example: The function receives a copy of the argument, modifies it, and then returns
the modified value, which can be assigned to the original variable outside the function.

For example:

c
Copy
int addTen(int x) {
x = x + 10; // Modifies the copy of the argument
return x; // Returns the modified value
}
int main() {
int a = 5;
a = addTen(a); // 'a' is updated with the returned value, now 'a' is 15
}

d) Pass by Name:

In pass by name, the formal parameters of a function are treated as textual


substitution. This means that the argument expressions are evaluated each time they
are referenced within the function. It is somewhat similar to macro substitution, where
the expression is evaluated in place of the parameter, rather than evaluating the value
of the argument at the time of the function call. This is a rare and less common
mechanism used in some languages like Algol.

Example: Each time the parameter is used in the function, the corresponding
argument is re-evaluated as an expression.

For example (in a hypothetical language):

algol
Copy
procedure addTen(x) {
x = x + 10;
}

begin
a := 5;
addTen(a+2); // 'a+2' will be re-evaluated in the function
end;

Here, every use of x within the addTen function will result in a + 2 being evaluated,
instead of passing a simple value.

Conclusion:

Each parameter passing mechanism has its unique behavior and use case:

Pass by value ensures that the original argument remains unchanged by using a
copy.

Pass by reference allows the function to modify the original argument directly by
passing its reference.

Pass by value-returned is a combination of pass by value with the ability to


return a modified value.
Pass by name provides a unique mechanism where the argument is re-evaluated
each time it is used, akin to macro expansion.

Understanding these different mechanisms is crucial for developers to control how


data flows through functions and procedures and to determine whether or not the
original arguments will be affected by the function’s operations.

You might also like