Midterm Examination for EEL 3801C: Assembly Programming, Exams of Computer Architecture and Organization

The midterm examination for the eel 3801c course focusing on assembly programming. The exam consists of six problems, including writing assembly programs for arithmetic expressions, error handling, array manipulation, and c language implementation. Students are expected to write uncommented and correct code within the given time frame.

Typology: Exams

Pre 2010

Uploaded on 11/08/2009

koofers-user-6po
koofers-user-6po 🇺🇸

2

(1)

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
EEL 3801C – Midterm examination
Date: March 4th, 2004
Name:
Student Code:
Instructions:
This exam is open book and open notes. Allotted time is 90 minutes.
Add comments to your code!!! Uncommented and incorrect code will not get
partial credit.
Note that the points add up to 120.
Problem 1 (20 points)
Write an assembly program which computes the expression
v = ((x + y) / z ) * u
where x, y, z, u and v are 16 bit integer variables. Assume that no overflow will happen
and the result and the partial results fit in 16 bit.
pf3
pf4
pf5

Partial preview of the text

Download Midterm Examination for EEL 3801C: Assembly Programming and more Exams Computer Architecture and Organization in PDF only on Docsity!

EEL 3801C – Midterm examination

Date: March 4th, 2004 Name: Student Code: Instructions:  This exam is open book and open notes. Allotted time is 90 minutes.  Add comments to your code!!! Uncommented and incorrect code will not get partial credit.  Note that the points add up to 120. Problem 1 (20 points) Write an assembly program which computes the expression v = ((x + y) / z ) * u where x, y, z, u and v are 16 bit integer variables. Assume that no overflow will happen and the result and the partial results fit in 16 bit.

Modify the assembly program from step 1 as follows:  add a byte variable ERRORCODE, which will be set as follows o ERRORCODE = 0 if the expression is correctly evaluated o ERRORCODE = 1 if there is an overflow at addition or subtraction o ERRORCODE = 2 if the result of a multiplication does not fit in 16 bits o ERRORCODE = 3 if there is a division with 0

Let ARRAY be an array of non-zero, positive, 8 bit integers, terminated with 0. Write an assembly language program which counts how many elements are greater than 42 and writes the answer into the 16 bit variable RESULT. An example of the array would be: ARRAY db 45, 6, 7, 8, 12, 80, 90, 0 In this case, the value of RESULT would be 3.

Implement problem 4 in the C language.