WBahn wrote
The math rules in Jack are deliberately ill-defined. There is NO defined precedence or associativity beyond the requirement that expressions in parentheses are evaluated first. Therefore an implementation is free to use whatever order of operations is convenient, which means that two perfectly valid implementations may produce different results. So your implementation may not produce the same results as the VM, but that doesn't make it wrong.
Jack may not have a multi before addition rule, but this is the VM-code
Looking at how the VM emulator calculates subtraction, it's obvious which number on the stack takes presedens over the other. It calculates M[SP-2] - M[SP-1], storing the result in M[SP-2], which after updating SP is M[SP-1].
If you calculate M[SP-1] - M[SP-2], you get the wrong answer, and the output fails.
The fact that the Hack computer architecture are missing a vital instruction (D=M-D), doesn't make the assembling easier.