# CS401 Computer Architecture and Assembly Language Programming Assignment No. 1 Solution and Discussion Spring 2017 Due Date: May 02, 2017

Questions No 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