On page 65 of the text, there's a sample Hack program that adds 1 continuously to a memory location 'i', until its value reaches 100. I looked through it and I think I understood it, but I don't yet get the use of the second mem. location 'sum'. It doesn't get checked for any conditional jumps, or increment 'i' in anyway. Am I overlooking something?
Thanks for the speedy reply! I guess I misunderstood the purpose of the program. Upon looking at it again I see what you're saying (sum=1+2+3...+100). I thought the sole purpose was just to add 1 to 'i' until 'i' reached 100, but 'i' just acts as a counter, and increments 'sum' while 'sum' adds to itself (which is what the program is for, and what is meant by 1+...+100).