JustinM wrote
After that I notice that R2 does not get cleared (it stays at 3), which causes the result of the 4x2 test to be 11, which of course throws a comparison failure.
You have found the problem with your code. This is a classic "uninitialized variable" bug.
To be a correct multiplication algorithm, your program must clear R2 before it starts the loop that adds to R2.
--Mark