Re:Two problems I had to solve in my Oxford interview (2013)
by joshvm on Tuesday May 12, 2015 @01:00AM
(#9529688)
Yep 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!
- inst. 4 should compare 0,4 , register 1 is unknown at this pt.
- inst. 3 should jump to 5