Assembly Language Program - Computer Organization - Homework, Exercises of Computer Architecture and Organization

These HOMEWOR NOTES are very easy to understand and very helpful to built a concept about the foundation of computers ORGANIZATION and Database Design.The key points in these slide are:Assembly Language Program, Set of Numbers, Positive Numbers, Zero Value, Sentinel Value, High-Level Language Algorithm, Window Capture, Simulator State, Array Values, Word Processor, Window's Clipboard

Typology: Exercises

2012/2013

Uploaded on 04/27/2013

arundhati
arundhati 🇮🇳

4.5

(23)

88 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Homework #4 Computer Organization
Write a ARM assembly language program to solve the following problem.
For a set of numbers stored in an array, calculate the sum of the positive numbers and the sum of the
negative numbers. The program should calculate both sums and store them to memory. Numbers in the
array with have a zero value (0) being used to signal the end of data (the zero value is acting as a "sentinel"
value).
For examle, your .data section for the array values: 10
10
-5
10
-30
10
15
10
20
10
-1
10
0
10
will be:
AREA SUM_POS_NEG, CODE, READONLY
ENTRY
; add your code here
STOP B STOP
AREA SUM_POS_NEG, DATA, READWRITE
ALIGN
NUMBERS DCD 10, -5, -30, 15, 20, -1, 0
POS_SUM DCD 0
NEG_SUM DCD 0
END
Before you start writing ARM assembly language, write a high-level language algorithm, THEN translate it to
ARM assembly language.
See the course web-page for links to download the ARM simulator for Windows at:
For non-Window’s users, you will need to use the Wright Hall 112 and 339 labs.
You should turn in:
a print-out of the ARM assembly language program file from inside the Keil uVision 4 IDE
a window capture of the simulator state after running your assembly language program with array values:
10
10
-5
10
-30
10
15
10
20
10
-1
10
0
10
and the POS_SUM result showing 45
10
and NEG_SUM result showing
-36
10
. You can capture this window by (1) right-clicking anywhere in the window to make it the "currently
active" window, (2) while holding down the <Alt> key, press the <PrtScn> key to capture the window into
the Window's clipboard, and (3) open some word processor (Word, Open Office, etc.) and paste the image
into the document. Add your name to this document before printing it.
Name:____________________
Docsity.com

Partial preview of the text

Download Assembly Language Program - Computer Organization - Homework and more Exercises Computer Architecture and Organization in PDF only on Docsity!

Homework #4 Computer Organization

Write a ARM assembly language program to solve the following problem.

For a set of numbers stored in an array, calculate the sum of the positive numbers and the sum of the negative numbers. The program should calculate both sums and store them to memory. Numbers in the array with have a zero value (0) being used to signal the end of data (the zero value is acting as a " sentinel " value).

For examle, your .data section for the array values: 10 10 -5 10 -30 10 1510 2010 -1 10 010 will be: AREA SUM_POS_NEG, CODE, READONLY ENTRY

; add your code here

STOP B STOP

AREA SUM_POS_NEG, DATA, READWRITE

ALIGN

NUMBERS DCD 10, -5, -30, 15, 20, -1, 0

POS_SUM DCD 0

NEG_SUM DCD 0

END

Before you start writing ARM assembly language, write a high-level language algorithm, THEN translate it to ARM assembly language.

See the course web-page for links to download the ARM simulator for Windows at:

For non-Window’s users, you will need to use the Wright Hall 112 and 339 labs.

You should turn in :  a print-out of the ARM assembly language program file from inside the Keil uVision 4 IDE  a window capture of the simulator state after running your assembly language program with array values: 1010 -5 10 -30 10 1510 2010 -1 10 010 and the POS_SUM result showing 45 10 and NEG_SUM result showing -36 10. You can capture this window by (1) right-clicking anywhere in the window to make it the "currently active" window, (2) while holding down the key, press the key to capture the window into the Window's clipboard, and (3) open some word processor (Word, Open Office, etc.) and paste the image into the document. Add your name to this document before printing it.

Name:____________________

Docsity.com