My solution to the problem: write a program in x86-64 Assembly which given an integer n returns the sum of numbers from 1 to n inclusive. This problem is part of CSPrimer. Test cases for this problem are not included in this post. This solution computes the sum of numbers from N down to 1. This post shares my thought process when solving this problem but does not explain assembly basics, so if you don’t know a bit of assembly, this post might be tricky to follow.
Share this post
Solving Sum To N in x86‑64 Assembly
Share this post
My solution to the problem: write a program in x86-64 Assembly which given an integer n returns the sum of numbers from 1 to n inclusive. This problem is part of CSPrimer. Test cases for this problem are not included in this post. This solution computes the sum of numbers from N down to 1. This post shares my thought process when solving this problem but does not explain assembly basics, so if you don’t know a bit of assembly, this post might be tricky to follow.