3 ms·
Couple corrections I think: - Register 4 should be set to zero before incrementing in instruction 2. - inst. 4 should compare 0,4 , register 1 is unknown at th
by elevensies 11y ago
Couple corrections I think:
- Register 4 should be set to zero before incrementing in instruction 2.
- inst. 4 should compare 0,4 , register 1 is unknown at this pt.
- inst. 3 should jump to 5
- joshvm 11y agoYep 3->5 is a typo. r4 could be zeroed, but I was lazy and assumed that as long as it's greater than zero it doesn't matter (since it's always compared to zero). Instruction 4 should be cmp(3,4) to force a jump to 9. EDIT: Although thinking about it, it doesn't make much difference. It has the same effect as doing cmp(0,4) since you know r4 > 0 and r0 == 0. Thanks!