You are on page 1of 3

Computer Architecture and Total marks = 20

Assembly Language Programming


(CS401) Deadline Date:

Assignment No. 2 December 22, 2021

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING


It should be clear that your assignment would not get any credit if:

 The assignment is submitted after the due date.


 The submitted assignment does not open or file is corrupt.
 Strict action will be taken if the submitted solution is copied from any other student or from
the internet.
You should concern the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.

Any other formats like scan images, PDF, zip, rar, ppt and bmp etc. will not be accepted.

Lectures covered: 7-14

Topics covered: Addition, Loop, Branching and sorting

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load
shedding or internet malfunctioning). Hence refrain from uploading your assignment in the last hours
of the deadline. It is recommended to upload the solution file at least two days before its closing date.

If you find any mistake or confusion in the assignment (Question statement), please contact your
instructor before the deadline. After the deadline, no queries will be entertained in this regard.

For any query, feel free to email at cs401@vu.edu.pk

Q. Write an assembly language program to perform the following tasks:


Task 1 - Find the largest digit in your VUID.

Task 2 - Add the largest value to each index value and write it back at the respective index of the
VUID. For example, if the numbers in VUID are 030400789, then after the task 2, the VUID
should become 91291399161718.

Task 3 - Find the arithmetic series of the largest digit found in task 1 and store it in the “dx”
register as shown in the sample screenshot.

Important Note:

The main assembly code should call a subroutine that performs Task 1, then another subroutine
would be called to calculate Task 2. After performing Task 2, it should call a subroutine to
calculate Task 3. When the Task 3 is completed then the control should go to the subroutine of
Task 2, then Task 1 and at end to the point where we initiate subroutine calling.

Arithmetic series is a sequence of numbers in which each differs from the preceding one by a
constant quantity. For example, the arithmetic series of ‘9’ can be calculated as follows:

9+8+7+6+5+4+3+2+1 = 45

Submission details:
Following are required in a single MS-Word document:

 Assembly language program.


 Screenshot of AFD debugger showing the arithmetic series of the largest digit and the
complete VUID in memory.

“Best of luck”

You might also like