2

This is on a Homework assignment for my intro to computer architecture and organization class.

Here is the full question:

Write code to calculate the sum of the square of numbers between 1 and 5. Create a variable SQSUM, initialize it with 0, and store the sum of the square of numbers between 1 and 5 in SQSUM. Find the address and Value of SQSUM in memory before and after the program is executed.

We are using Keil Uvision 5 MDK-ARM Version 5.28 with legacy support for ARM7, ARM9 and cortex-R

I have the code

    AREA Long, CODE, READWRITE 
    ENTRY
    MOV r0, #0 
    MOV r1, #1

Loop MUL r2,r1,r1 ADD r0,r0,r2

    ADD r1,r1,#1
    CMP r1, #6
    BNE Loop
    STR r0, SQSUM

S B S SQSUM DCD 0 END

which works, it is the last part I can not figure out, i know the values i just do not have a clue how to find the address.

Please help Thank you

Chanaka Weerasinghe
  • 5,404
  • 2
  • 26
  • 39
Spam Spam
  • 21
  • 2

0 Answers0