0% found this document useful (0 votes)
2 views

assembly assignment

This document provides a comprehensive overview of the 8086 microprocessor, detailing its instructions, addressing modes, control signals, and differences from other microprocessors like the 8085 and 8088. It also discusses the functions of various control pins, the 80x86 family of CPUs, and parameter passing mechanisms in assembly programming. The content is structured into sections that cover key aspects of microprocessor architecture and functionality, enhancing understanding of its applications in computing.

Uploaded by

amanuel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

assembly assignment

This document provides a comprehensive overview of the 8086 microprocessor, detailing its instructions, addressing modes, control signals, and differences from other microprocessors like the 8085 and 8088. It also discusses the functions of various control pins, the 80x86 family of CPUs, and parameter passing mechanisms in assembly programming. The content is structured into sections that cover key aspects of microprocessor architecture and functionality, enhancing understanding of its applications in computing.

Uploaded by

amanuel
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

ARBAMIN

CH
UNIVERSI
Institute of technology faculty of
computing andTY software engineering

Microprocessor and assembly language


programming Group assignment

Sectio
Roll
no nB
Student’s Name ID
1 Hayatuden Jemal NSR/484/15
2 Sara Abera NSR/822/15
3 Abenezer Basazenew NSR/044/15
4 Hana Yohannes NSR/468/15
5 Sifan Abduselam NSR/848/15
6 Yordanos Mesfin NSR/1022/15
7 Kaleb Mulugeta NSR/535/15
8 Yewubdar Sebsibe NSR/993/15
9 Yitages Adane NSR/2747/14
10 Amir Mesfin NSR/099/15

Submitted to: Inst. Amanuel


Introduction

The study of microprocessors, specifically the 8086, is integral to


understanding modern computing systems. This document delves into key
aspects of the 8086 microprocessor, offering insights into its instructions,
addressing modes, and the differences between it and its counterparts like
the 8087, 8088, and 8085. It also explores essential control signals such as
READY, ALE, HOLD, and RESET, alongside the interrupt mechanisms in
hardware and software. The purpose and use of directives in assembly
programming are illustrated with examples, while parameter passing
mechanisms provide a foundation for understanding how data is managed
within functions. These topics provide a comprehensive overview of the
architecture and operational principles of the 8086 microprocessor and
related systems, enabling a deeper grasp of the processor’s functionality
and its applications in computational tasks.
1. List Various Instructions of 8086 and How They Work
1. Data Transfer Instructions: These instructions are used to transfer data between
registers, memory, or I/O ports.
MOV: Transfer data from source to destination.
PUSH: Push data onto the stack.
POP: Pop data from the stack.
XCHG: Exchange data between two registers.

2. Arithmetic Instructions: Perform arithmetic operations like addition, subtraction,


etc.
ADD: Add source operand to destination operand.
SUB: Subtract source operand from destination operand.
MUL: Perform unsigned multiplication.
DIV: Perform unsigned division.

3. Logical Instructions: Perform logical operations such as AND, OR, XOR.


AND: Perform bitwise AND operation.
OR: Perform bitwise OR operation.
NOT: Perform bitwise NOT operation.

4. Control Transfer Instructions: Change the flow of execution.


JMP: Unconditional jump.
CALL: Call a subroutine.
RET: Return from a subroutine.

5. String Manipulation Instructions: Operate on strings.


MOVS: Move string data.
CMPS: Compare strings.

Each instruction has a specific opcode and operates on the designated operands to
perform the intended operation.

Conclusion

The 8086 instructions enable efficient data handling, computations, and program control,
making it versatile for various applications.
2. Explain Various Control Instructions
Control instructions are used to alter the sequence of execution in a program. They are
categorized as follows:

1. Unconditional Control Transfer Instructions: Transfer control unconditionally.


JMP: Unconditionally jump to a specified address.

2. Conditional Control Transfer Instructions: Transfer control based on a condition.


JZ/JE: Jump if zero/equal.
JNZ/JNE: Jump if not zero/not equal.
JC: Jump if carry flag is set.

3. Subroutine Call Instructions: Used to call procedures.


CALL: Call a procedure.
RET: Return from a procedure.

4. Interrupt Instructions: Used to handle interrupts.


INT: Trigger an interrupt.
IRET: Return from an interrupt.

Conclusion

Control instructions in the 8086 microprocessor enable precise management of program


execution, including flow redirection, subroutine handling, and interrupt processing,
ensuring efficient and flexible operation.

3. Explain Various Addressing Modes of 8086


Addressing modes specify the way in which the operand is accessed. The various
addressing modes of 8086 are:

1. Immediate Addressing Mode: Operand is specified explicitly in the instruction.


Example: MOV AX, 1234H.

2. Register Addressing Mode: Operand is in a register.


Example: MOV AX, BX.

3. Direct Addressing Mode: Operand is at a specific memory address.


Example: MOV AX, [1234H].
4. Indirect Addressing Mode: Operand is at a memory location pointed to by a
register.
Example: MOV AX, [BX].

5. Indexed Addressing Mode: Operand is at an address computed by adding a


constant to a base address.
Example: MOV AX, [BX+SI].

6. Relative Addressing Mode: Used for branch instructions where the operand
specifies a relative address.
Example: JMP SHORT LABEL.

Each mode provides flexibility for programming by allowing different methods of


accessing data.

4. Difference Between 8087 Intel Co Processor and 8086


Microprocessor
The 8087 Intel Co Processor and the 8086 Microprocessor have the following differences:

1. Purpose:
8086: General purpose microprocessor used for executing instructions.
8087: Math co processor designed to handle floating point operations.

2. Functionality:
8086: Executes general instructions including arithmetic, logical, and control.
8087: Performs complex arithmetic operations like square root, trigonometric functions,
etc.

3. Integration:
8086: Standalone processor.
8087: Works in conjunction with the 8086.

4. Instruction Set:
8086: General purpose instructions.
8087: Specialized floating point instructions.

5. Architecture:
8086: Uses 16 bit architecture.
8087: Operates on 80 bit floating point registers.

In summary, the 8087 co processor enhances the computational capabilities of the 8086
microprocessor by efficiently handling mathematical operations.
5. What are the functions of READY, ALE, HOLD, and RESET
pins of the 8086 microprocessor?
1. READY Pin:
Function:
It is an input signal used to synchronize the processor with slower peripheral devices. If
the READY pin is low, the 8086 enters a wait state until it goes high.

Use Case:
Ensures proper communication with slower devices like memory or I/O ports.

2. ALE (Address Latch Enable) Pin:


Function:
ALE is an output signal that indicates the presence of valid address data on the
multiplexed address/data bus. It is used to latch the lower address during the first clock
cycle.

Use Case:
Helps separate address and data lines in the multiplexed bus architecture.

3. HOLD Pin:
Function:
It is an input signal used by external devices to request control of the system bus. When
asserted, the microprocessor releases the bus after completing the current operation.

Use Case:
Useful in direct memory access (DMA) operations.

4. RESET Pin:
Function:
It is an input signal used to reset the processor. When activated, it initializes the registers
and sets the program counter to 0xFFFF0.

Use Case:
Resets the microprocessor to its default state.

Conclusion:
These pins are crucial for interfacing, synchronization, and controlling the operations of
the 8086 microprocessor in various scenarios.
6. Discuss the 80X86 family of CPUs
The 80x86 family of CPUs refers to Intel's series of microprocessors based on the x86
architecture. These processors introduced a wide range of capabilities and improved
computing over time.

Key Features of the 80x86 Family:


1. Backward Compatibility:
Each newer CPU retained compatibility with its predecessors, allowing software
written for older processors to run on newer ones.
2. Segmentation:
Introduced memory segmentation to address more than 64KB of memory.
3. Enhanced Performance:
Improved processing power with faster clock speeds and better instruction sets.

Evolution of the 80x86 Family:


1. 8086:
First 16 bit microprocessor with a 20 bit address bus and capable of addressing 1MB of
memory.
2. 8088:
Similar to 8086 but with an 8 bit data bus.
3. 80286:
Introduced protected mode, allowing access to up to 16MB of memory.
4. 80386:
A 32 bit processor with enhanced multitasking and 4GB addressable memory.
5. 80486:
Integrated FPU (floating point unit) for better arithmetic calculations.
6. Pentium Processors:
Enhanced superscalar architecture and multimedia capabilities.
Conclusion
The 80x86 family laid the foundation for modern computing, with continuous
enhancements in speed, functionality, and memory management.

7. Compare 8085, 8086, and 8088 Microprocessors with


Each Other
The 8085, 8086, and 8088 microprocessors are pivotal in the evolution of computing
systems. Each processor has unique characteristics and capabilities that distinguish it.
The comparison below highlights their key features, architecture, and functionalities.

Comparison Table
Feature 8085 Microprocessor 8086 Microprocessor 8088 Microprocessor
Processor Type 8-bit microprocessor 16-bit microprocessor 16-bit microprocessor
Data Bus Width 8 bits 16 bits 8 bits
Address Bus Width 16 bits 20 bits 20 bits
Memory Addressing 64 KB 1 MB 1 MB
Instruction Set Limited Extensive and supports Similar to 8086 but
16-bit operations optimized for 8-bit
data bus
Clock Speed Up to 3 MHz Up to 10 MHz Up to 10 MHz
Applications Basic control and Advanced computing Applications requiring
simple tasks systems a 16-bit processor with
8-bit data
compatibility

In summary, the 8085 is an 8-bit microprocessor suitable for basic tasks, while the
8086 offers enhanced performance and functionality for more complex operations.
The 8088, similar to the 8086, is optimized for compatibility with 8-bit systems,
making it a versatile choice for specific applications.

8. What do you mean by interrupt in hardware and


software? List the types of hardware and software
interrupts in 8086.
Interrupt:
An interrupt is a signal that temporarily halts the CPU's current task to execute a specific
routine, after which it resumes the interrupted task.

1. Hardware Interrupts:
Generated by external devices to gain the attention of the CPU.

Types in 8086:
1. INTR (Interrupt Request): Maskable interrupt triggered by external hardware.
2. NMI (Non Maskable Interrupt): A high priority interrupt that cannot be disabled.

2. Software Interrupts:
Generated by executing specific instructions in the program.

Types in 8086:
1. INT n (Interrupt Instruction): Allows software to call an interrupt service routine.
2. INT 3 (Breakpoint Interrupt): Used for debugging.
Conclusion:
Hardware interrupts are device driven, while software interrupts are programmer
controlled, both essential for efficient system operation.
9 What are the purposes of using directives? Show by
giving different kinds of examples.
Directives are instructions provided to the assembler to control the assembly process.
They do not generate machine code but provide essential information on how to organize
and structure the program. They are crucial for defining data, memory segments,
constants, and organizing code efficiently.
Key Purposes of Directives

Define Data
Directives are used to allocate memory for variables and initialize data.

Code Organization
Directives help to structure code by defining segments (data, code, stack) and procedures.

Define Constants
Directives allow defining constant values for reuse, improving readability and
maintainability.

Control Assembly Process


Directives like ORG set the starting address of the program, and others specify conditions
for conditional assembly.

Examples of Common Directives

Data Definition Directives

DB (Define Byte): Allocates a byte sized variable and optionally initializes it.

DW (Define Word): Allocates a word sized variable (2 bytes).

DD (Define Double Word): Allocates 4 bytes of memory.


Equate Directive (EQU)

Used to define constants or symbolic names.

Example:

Segment Definition Directives

SEGMENT and ENDS: Define the start and end of segments like data, stack, or code.

Procedure Definition Directives

PROC and ENDP: Used to define and end procedures.

Example:

assembly
CopyEdit
MyProc PROC
MOV AX, 0
RET
MyProc ENDP

Benefits of Using Directives

 Simplify program development.


 Improve code readability and maintainability.
 Allow efficient memory management.
 Enable modular and reusable code.

10Explain the difference between immediate and indirect


operand instructions.
Difference between Immediate and Indirect Operand Instructions

Operands in assembly language specify the data to be operated upon. The difference
between immediate and indirect operands lies in how the data is accessed.

Immediate Operand Instruction

 The operand is directly specified in the instruction itself.


 The value is a constant embedded in the instruction.
 No additional memory access is required, making it faster.
 Used for initializing registers or performing operations with constants.

example

5 and 10 are immediate operands.

The values are directly part of the instruction.

Indirect Operand Instruction

 The operand is stored in memory, and its address is specified indirectly (via a
register or a pointer).
 Requires one or more memory accesses to fetch the operand.
 Used for dynamic or variable data stored in memory.

Example
MOV BX, 2000h ; Load the memory address 2000h into BX

MOV AX, [BX] ; Load the value at address 2000h into AX


The key deference
I
Feature Immediate Operand indirect Operand
Data Location Embedded in the instruction Itself Stored in memory at a specific
address
Speed Faster (no memory access required) Slower (requires memory access)
Flexibility Fixed, constant values Can point to variable or dynamic
data
Instruction Size Larger (includes operand value) Smaller (only includes the
address)
Use Case Constants and initialization Accessing variable data in
memory
I
Feature Immediate Operand indirect Operand
Data Location Embedded in the instruction Itself Stored in memory at a specific
address
Speed Faster (no memory access required) Slower (requires memory access)
Flexibility Fixed, constant values Can point to variable or dynamic
data
Instruction Size Larger (includes operand value) Smaller (only includes the
address)
Use Case Constants and initialization Accessing variable data in
memory

11How do the following parameter passing mechanisms


work?

Parameter Passing Mechanisms


Parameter passing is the way arguments are sent to and received by functions or
procedures. The following describes how each mechanism works:

a) Pass by Value

A copy of the actual parameter is passed to the function.


The function operates on the copy, so changes made to the parameter inside the
function do not affect the original value.

Commonly used in assembly by pushing values onto the stack.

In the procedure, the value of AX on the stack is modified, but the original AX remains
unchanged.

b) Pass by Reference

The address of the actual parameter is passed to the function.

The function can directly access and modify the original value.

This is efficient for large data structures since only the address is passed.

Example in Assembly (Simulated):

In the procedure, the memory at the address in BX is modified, affecting the original
variable.

c) Pass by Value Returned

A copy of the parameter is passed, but the updated value is copied back to the caller
once the function finishes.

Combines aspects of pass by value and pass by reference.

Common in languages like Fortran.

d) Pass by Name

The parameter is not evaluated when passed. Instead, the actual code (or expression)
is substituted into the function.

The parameter is evaluated whenever it is used inside the function.


This allows for lazy evaluation, which is common in functional programming or some
older languages like Algol.

Mechanism What is Passed Effect on Original Typical Use Case


Data
Pass by Value Copy of the parameter No effect Simple calculations,
constants
Pass by Reference Address of the parameter Original value modified Arrays, large structures
Pass by Value-Returned Copy + update origina Original value updated Fortran-style functions
Pass by Name Unevaluated expression Depends on evaluation Lazy evaluation, special
cases

You might also like