We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

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

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

plz send solution

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Views: 7033

Attachments:

Replies to This Discussion

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions. Read More>>

Note:-

For Important Helping Material related to this subject (Solved MCQs, Short Notes, Solved past Papers, E-Books, FAQ,Short Questions Answers & more). You must view all the featured Discussion in this subject group.

For how you can view all the Featured discussions click on the Back to Subject Name Discussions link below the title of this Discussion & then under featured Discussion corner click on the view all link.

&

.... How to Find Your Subject Study Group & Join ....

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

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

Arrays in Assembly Language

There are two ways to define an array in assembly language.

12.4.1. Initialized Lists

An initialized array is defined in the same way as a scalar variable, but with multiple initial values.

`        scores: .word   100, 78, 63, 88, 52, 91, 75             `

MAL also provides a mechanism for defining a large array with all elements initialized to the same value:

`        scores: .word   0:100           `

12.4.2. Uninitialized Memory Blocks

Uninitialized arrays are defined using the `.space` directive.

Caution

The `.space` directive allocates the specified number of bytes. Specifying the desired number of array elements is a common mistake.
`        scores: .space 400      `

12.4.3. Working with Arrays

To access an array in assembly language, we use a pointer. A pointer is simply a register or variable that contains a memory address.

The value in the pointer is computed as shown in the previous sections by adding the base address of the array and the offset of the desired element.

Thanks sir

Dear Students Don’t wait for solution post your problems here and discuss ... after discussion a perfect solution will come in a result. So, Start it now, replies here give your comments according to your knowledge and understandings....

Any idea of question #2?
I am not getting the answer according to the instructions given

CS401 Assignment 1 Sp17 Solution idea

Attachments:

CS401 Assignment 1 Idea Solution
Arrays in Assembly Language
There are two ways to define an array in assembly language.
12.4.1. Initialized Lists
An initialized array is defined in the same way as a scalar variable, but with multiple initial values.
scores: .word 100, 78, 63, 88, 52, 91, 75
MAL also provides a mechanism for defining a large array with all elements initialized to the same value:
scores: .word 0:100
12.4.2. Uninitialized Memory Blocks
Uninitialized arrays are defined using the .space directive.
Caution
The .space directive allocates the specified number of bytes. Specifying the desired number of array elements is a common mistake.
scores: .space 400
12.4.3. Working with Arrays
To access an array in assembly language, we use a pointer. A pointer is simply a register or variable that contains a memory address.
The value in the pointer is computed as shown in the previous sections by adding the base address of the array and the offset of the desired element.

Seems all correct but can you tell the procedure how to calculate the physical address as in the your file you just wrote the calculated answer. It will be very helpful if you tell that how did u calculated that!

I can assure about 1st question that it is correct. While taking sometime will get u know bout 100% surety

Latest Activity

+++A++R+++ and Hajjvery BS IT are now friends
44 minutes ago
Mirha Malik and M. Haris are now friends
1 hour ago
Mani Siddiqui Ex posted a discussion

عجیب ایجاد

2 hours ago
Hajjvery BS IT liked sam's profile
2 hours ago
Hajjvery BS IT liked sam's profile
2 hours ago
Hajjvery BS IT liked sam's profile
2 hours ago
Hajjvery BS IT liked sam's profile
2 hours ago
Hajjvery BS IT liked sam's profile
2 hours ago

1

2

3

HELP SUPPORT

This is a member-supported website. Your contribution is greatly appreciated!