0% found this document useful (0 votes)
7 views2 pages

MPL - Assignment

The document outlines an assignment for a Microprocessor Lab course at MES’s Wadia College of Engineering, focusing on writing an assembly language program to count positive and negative numbers in an array. It includes objectives, outcomes, prerequisites, hardware and software requirements, as well as a detailed algorithm for implementation. Additionally, it provides instructions for compiling and linking the assembly program using NASM and includes questions for further understanding of assembly language concepts.
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)
7 views2 pages

MPL - Assignment

The document outlines an assignment for a Microprocessor Lab course at MES’s Wadia College of Engineering, focusing on writing an assembly language program to count positive and negative numbers in an array. It includes objectives, outcomes, prerequisites, hardware and software requirements, as well as a detailed algorithm for implementation. Additionally, it provides instructions for compiling and linking the assembly program using NASM and includes questions for further understanding of assembly language concepts.
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/ 2

MES’s Wadia College of Engineering, Pune

SUBJECT: MICROPROCESSOR LAB (MPL)

NAME:

CLASS: SE COMP ROLL NO.:


SEMESTER: SEM-II YEAR: 2023-24

DATE OF PERFORMANCE: DATE OF SUBMISSION:

EXAMINED: Prof. G. B. Aochar

Assignment No-05
Title:- Count no. of positive and negative numbers
Assignment Name: - Write an ALP to count no. of positive and negative numbers from
the array.

Objective:-
● To understand the assembly language program
● To understand 64 bit interrupt.
Outcome:-
● Students will be able to write code for how to count positive and negative
number from array

● Students will be able to understand different assembly language instruction.

Prerequisite:-

System call of Unix for Assembly language Program.


Hardware Requirement-
Desktop PC
Software Requirement-
Ubuntu 14.04,
Assembler: NASM
version 2.10.07
Linker: ld

MPL Handouts Department of Computer Engg. 1


MES’s Wadia College of Engineering, Pune

Introduction:-
Write System Call

mov rax,1
mov rdi,1
mov rsi,%1
mov rdx,%2
syscall

Read System Call

mov rax,0
mov rdi,0
mov rsi,%1
mov rdx,%2
syscall

Compiling and Linking an Assembly Program in NASM


1. Type the above code using a text editor and save it as assignment1.asm.
2. Make sure that you are in the same directory as where you saved
assignment1.asm.
3. To assemble the program, type nasm -f elf64 assignment1.asm
4. If there is any error, you will be prompted about that at this stage.
Otherwise an object file of your program named assignment1.o will be
created.
5. To link the object file and create an executable file named assignment1,
type ld -o assignment assignment1.o
6. Execute the program by typing ./assignment1

Algorithm:
1. Start
2. Initialize section .data
3. Define variable for array, pcount, ncount
4. Count Positive and negative number using BT command.
5. Display counts
6. Terminate program using system call
6. Stop
Conclusion:- Hence we implemented an ALP to count positive and negative
number from array and display count.
Questions:-
1. Explain BT,JS,loop instruction with Example?
2. Explain Paging in 80386?
3. Draw control registers of 80386

MPL Handouts Department of Computer Engg. 2

You might also like