Question: Write a program in Hack VM code to multiply 2 numbers a = x x y. Complete the code in Mult.vm Where: a is
Write a program in Hack VM code to multiply 2 numbers a = x x y. Complete the code in Mult.vm Where: a is a local variable x & y are both static variables (supplied in that order) You are required to implement the multiplication algorithm yourself; solutions using the inbuilt Math function will not receive marks. 1 2 AWN 3 4 5 // Put your code here. push local 1 6 7 add 8 9 10 // Calculates a = x*y // a is a local variable // x & y are static variables 11 12 13 push static sub label END goto END
Step by Step Solution
There are 3 Steps involved in it
Code static int x static int y func Multiplya x y a x y return a Explanation This programme will mul... View full answer
Get step-by-step solutions from verified subject matter experts
