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

Assignment#3

Uploaded by

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

Assignment#3

Uploaded by

Muhammad Taaha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

National University of Computer & Emerging Sciences, Karachi

Fall2024 CS Department
Assignment No. 03
30th November 2024
Course Code: EE2003 Course Name: Computer Organization & Assembly Language
Instructor Names: Shoaib Rauf, Kashan, Aashir Mahboob, Atiya, Kariz Kamal , Muhammad Usman,
Nauraiz Subhan
Instructions:
 Attempt all the questions.
 Don’t share your work, if your submission is matched to any member of your class, both will be
marked 0 straight without asking who shared or who magically copied.
 No late submissions will be accepted.
 Assignment should be Hand written and a PDF file of scanned copies must be uploaded on GCR.
Max Points: 30

Question 1. [5] Points


Write a recursive procedure in x86 assembly language that divides a number by another number and stops
when dividend is less than or equal to 5h. Consider dividend = D4A4h and divisor = Ah. The Intel IA 32
version of this program is required.

Questions 2 [5] Points


Write a recursive procedure to find a value in a large integer array. Ask the user to enter an integer value in
the main program. You should pass user supplied value as parameter to the recursive function using the
INVOKE directive. Also, draw labeled diagrams to show stack values at each iteration of this recursive
function.

Question 3 [5] Points

Write an assembly language program to copy the characters of a string to a target string. The characters are
stored in such a way that only a single instance of any character in the string is stored. Initialize a source
string to: "This is the source string".

Question 4 [5] Points


Write an assembly language program to read a string of characters from the user and prints/store the
vowel count. For each vowel, the count includes both uppercase and lowercase letters. For example, the
input string

“Advanced Programming in UNIX Environment”

Produces the following output:

Vowel Count

a or A = 3 i or I = 4 u or U = 1

e or E = 3 o or O = 2

1
Question 5 [5] Points
Write a procedure named DifferentInputs that returns EAX = 1 if the values of its three input parameters
are all different; otherwise, return with EAX = 0. Use the PROC directive with a parameter list when
declaring the procedure. Create a PROTO declaration for your procedure, and call it five times from a
test program that passes different inputs.

Question 6 [5] Points


Create a variant of the Str_trim procedure that lets the caller remove all instances of a leading character
from a string. For example, if you were to call it with a pointer to the string “###ABC” and pass it the #
character, the resulting string would be “ABC”.

You might also like