0% found this document useful (0 votes)
3 views3 pages

Microprocessor Lab 1

The lab focuses on applying the 8086 instruction set to create an assembly program that utilizes a hash function and hash table mechanism. Students break down their IDs into hexadecimal values, design a hash function, and retrieve physical memory addresses based on calculated remainders. The lab successfully demonstrates the use of various addressing modes and instruction sets in assembly language.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Microprocessor Lab 1

The lab focuses on applying the 8086 instruction set to create an assembly program that utilizes a hash function and hash table mechanism. Students break down their IDs into hexadecimal values, design a hash function, and retrieve physical memory addresses based on calculated remainders. The lab successfully demonstrates the use of various addressing modes and instruction sets in assembly language.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

__________________________________________________________________________

SCHOOL OF ENGINEERING AND TECHNOLOGY


SUBJECT CODE AND NAME: ETC2053 MICROPROCESSOR SYSTEMS
ASSESSMENT NAME: GRADED LAB 1
DUE DATE: 17 DECEMBER 2025

NO. STUDENT ID STUDENT NAME


1 24083826 OGOOLUWA EMMANUEL ADEGOKE
2 23092679 KAZUKI LOH LINTON

Aim and Objective of This Lab:


The objective is to learn and apply the instruction set 8086 practically. We are to build and assembly
program that uses hash function and hash table mecahnism. The scope of our lab is ass follows:
 Using either of our student ID and breaking the number into 4 hexadecimal values that will be
stored in memory.
 Designing a hash funtion using arithmetic and logical instruction in the assembly language.
(Although we are not required to go too indepth in hash function).
 Division of a number with prime numbers and saving the remainder as index of the hash table.
 The retrieval of physical memory address using the remainders and checking the correctness.
List of Registers and Instructions Adopted:
Registers:
 AX: Used as an accumukator for arithmetic and logical opertaions.
 BX: Used as a base register to point to memory locations.
 CX: Used as a loop counter.
 DX: Used with AX (DX:AX) during division operations and stores the remainder after division.
 SI: Used as an index register to access array elements in memory.

Instructions:
 MOV: Used to transfer data between registers and memory.
 XOR: Performs a logical XOR operation to modify the data.
 SHL: Shifts bits to the left.
 DIV: Divides the value located in AX by a divisor.
 ADD: Adds a value to the register.
 INC: Increases a register value by 1.

Explanation and Logic of the Assemly Program:


Student ID: 24083826 was used and broken down into 4 and converted into hexadecimal.
24 => 0x18
08 => 0x08
38 => 0x26
26 => 0x1A

The hexadecimal values are placed in the memory addresses consecutively in form of an array.
Individual values are then recalled by index addressing using SI register.
Each of the resulting values is subjected to hash function.
The data is changed logically using XOR, and then SHL moves all bits to the left and then INC
further increments the result by 1.
Once, the hash value is obtained, it is then partitioned by a prime number. 5, 7 and 11 were tried, with
11 being the number that led to a lesser number of remainders compared to others. The rest was then
put in an array in the memory and was utilized later to calculate the physical memory address where
the hash value is stored.
Presentation and Verification of Result:
Hash Function Results
Input(Hexa) Hash Remainder(divided Remainder(Divided Remainder(Divided
Value by 5) by 7) by 11)
(Decimal)
0x18 47 2 5 3
0x08 31 1 3 9
0x26 81 1 4 4
0x1A 43 3 1 10

List of Addressing Modes Used:


Register addressing mode like when doig actions on register AX.
Register Indirect addressing mode.
Immediate addressing mode.
Indexed addressing mode.

Physical Memory Addresses Utilized:


Since the last digit of my student number 24083826 is 6:
Physical addresss = 0x10600 + Remainder.
Remainder 3: Physical address = 0x10603 (Input hexadecimal: 0x18)
Remainder 9: Physical address = 0x10609 (Input hexadecimal: 0x08)
Remainder 4: Physical address = 0x10604 (Input hexadecimal: 0x26)
Remainder 10: Physical address = 0x1060A (Input hexadecimal: 0x1A)

Conclusion
The assembly language consisted of 8086 and we were able to meet all our goals of this lab by using a
hash table. Modes of instruction were understood and addressing better and apply hash tables on
assembly language.

You might also like