|
Hello, I don't know if this has been found yet or not.
In chapter 11 in figure 11.6 It shows a vm command version of a jack line of code
let balance = (balance + sum) - commission(sum * 5);
the problem is with the commission method. The vm commands shown in the book differs from the vm code generated by the jackCompiler.
snippit from book
push argument 0// implicit parameter
push argument 1 //argument sum
push constant 5 //constant
call Math.multiply 2 //
call BankAccount.commission 2
end snippet
however, in the vm code generated by the given jackCompler, the implicit parameter is "push pointer 0"
Are these commands EQUIVALENT within the context? I think its equivalent, but I want to double check with you guys.
|