×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Nested Loop Help

Nested Loop Help

Nested Loop Help

(OP)
Here's what I have so far:

          Move      #LIST,R0
          Clear     R1
          Clear     R2
          Clear     R3
          Move      N,R4
          Add       4(R0),R1
          Add       8(R0),R2
          Add       12(R0),R3
          Add       #16, R0
          Decrement R4
          Branch>0  LOOP
          Move      R1, SUM1
          Move      R2, SUM2
          Move      R3, SUM3

No this works for when I have a set amount of different SUMS but I'm trying to make it so that I do not know the amount of SUMS there will be.  I'm trying to assume an unkown say j.

I realize I need 2 nested loops but not sure how to set them up.

Any advice on this?  Need me t explain better?

RE: Nested Loop Help

(OP)
Assume there are n students.
Assume that j is stored in memory location J, placed ahead of location N
Write a program for computing sums of the scores on each test and store these sums in the memory word locations at addresses SUM, SUM +4, SUM +8, .... The number of tests, j, is larger than the number of registers in the processorer.

So the type of program I've written for the 3-test case cannot be used.

I need to use two nested loops. The inner loop should accumulate the sum for a particular test, and ***** outer loop should run over the number of tests, j.

Does that help???


RE: Nested Loop Help

(OP)
Assume there are n students.
Assume that j is stored in memory location J, placed ahead of location N
Write a program for computing sums of the scores on each test and store these sums in the memory word locations at addresses SUM, SUM +4, SUM +8, .... The number of tests, j, is larger than the number of registers in the processorer.

So the type of program I've written for the 3-test case cannot be used.

I need to use two nested loops. The inner loop should accumulate the sum for a particular test, and ***** outer loop should run over the number of tests, j.

Does that help???


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close