CS401 Computer Architecture and Assembly Language Programming Assignment No. 1 Solution Spring 2017

CS401 Computer Architecture and Assembly Language Programming Assignment No. 1 Solution Spring 2017

Computer Architecture and Assembly Language Programming (CS401)

Assignment # 01

 

Total marks = 20                                                                              

 

Deadline Date

2ndof May,

2017

 

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 submitted solution is copied from any other student or from the internet.

 

You should consultthe recommended books to clarify your concepts as handouts are not sufficient.

 

You are supposed to submit your assignment in .doc or docxformat.

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

 

Topic Covered:

·         Registers

·         Intel Architecture

·         Register Architecture

·         Data Declaration

·         Addressing Modes

 

 

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 etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

 

If you people find any mistake or confusion in assignment (Question statement), please consult with 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

 

 

 

QuestionsNo 01                                                                                10 marks

Write an assembly language code that will:

  • Initialize an array named as “Even”, which contain first ten EVEN numbers.

Even = 0,2,4,6,8,10,12,14,16,18

  • Initialize an array named as “Odd”, which contain first ten ODD numbers.

Odd=1,3,5,7,9,11,13,15,17,19,21

  • Add Both arrays (index wise) into a third array named as “Sum”.

SUM [0] = Even [0] + Odd [0]

SUM [1] = Even [1] + Odd [1]

Up to

SUM[n] = Even[n] + Odd[n]

 

Note: You cannot use LOOP or any other repetitive structure to solve this questions.

 

Questions No 02                                                                               10 marks

Suppose, we have the following register values:

 

AX FA10 DS 32FA SI 222A
BX 050C CS 6FDE SP 6D6E
CX 1202 ES E9A2 BP FF21
DX FFEF SS CD33 DI 2829

 

You are required to calculate the physical address generated by each of the following instructions.

 

  1. MOV [bP+Fa21], AX
  2. ADDCX, [SP+FaFa]

 

Note: Each provided instruction is independent & all numbers are stated in Hexadecimal number system.

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
×

Hello!

Click one of our contacts below to chat on WhatsApp

× WhatsApp Us