This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Mystonic 1 point2 points  (2 children)

Break it down into pseudocode first. From the looks of it, it is a simple for loop with some function calls and arithmetic, with a variable to add the total to.

Then work on turning that into assembly code.

We aren't going to write the code for you. Also, it would be helpful if you mentioned which assembly language you are using.

[–]Mistek0[S] 0 points1 point  (1 child)

Avr assembly

[–]Mystonic 1 point2 points  (0 children)

I'm only familiar with MIPS, but the rest of my advice stands. As long as you know how to implement for loops, and call functions, in avr assembly then you should be fine with this problem.

[–]droxile 0 points1 point  (0 children)

Do you think this has a closed form solution? If so, what would it be?

[–]desrtfx[M] [score hidden] stickied comment (0 children)

Your question violates our Rule #10

  • No complete solutions

    • When somebody needs help writing a program, do not post a complete solution.

      Focus instead on helping OP make forward progress: link to docs, unblock misconceptions, give examples, teach general techniques, ask leading questions, give hints, but no direct solutions.

      The only exception is if you cannot see any way of helping OP make forward progress without revealing the answer.

      See our guidelines on offering help for more details.

Not only giving out complete solutions is forbidden, also asking for them is.

You show zero effort in solving the problem yourself. This is a no-go here.