Hack Computer Machine Language The Elements of Computing Systems Project 4 Solution

Content is a summary and my notes mainly but not only from:

The Elements of Computing Systems: Building a Modern Computer from First Principles
by Noam Nisan


Solution to Project 4

Multiplication Program (Mult.asm): The inputs of this program are the current values stored in R0 and R1 (i.e., the two top RAM locations). The program computes the product R0*R1 and stores the result in R2. We assume (in this program) that R0>=0, R1>=0, and R0*R1<32768. Your program need not test these conditions, but rather assume that they hold. The supplied Mult.tst and Mult.cmp scripts will test myour program on several representative data values.