assembly assignment
assembly assignment
CH
UNIVERSI
Institute of technology faculty of
computing andTY software engineering
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
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:
Conclusion
6. Relative Addressing Mode: Used for branch instructions where the operand
specifies a relative address.
Example: JMP SHORT LABEL.
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.
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.
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.
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.
DB (Define Byte): Allocates a byte sized variable and optionally initializes it.
Example:
SEGMENT and ENDS: Define the start and end of segments like data, stack, or code.
Example:
assembly
CopyEdit
MyProc PROC
MOV AX, 0
RET
MyProc ENDP
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.
example
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
a) Pass by Value
In the procedure, the value of AX on the stack is modified, but the original AX remains
unchanged.
b) Pass by Reference
The function can directly access and modify the original value.
This is efficient for large data structures since only the address is passed.
In the procedure, the memory at the address in BX is modified, affecting the original
variable.
A copy of the parameter is passed, but the updated value is copied back to the caller
once the function finishes.
d) Pass by Name
The parameter is not evaluated when passed. Instead, the actual code (or expression)
is substituted into the function.