;; This program reads in 3 numbers a, b, and c. ;; It outputs 1 if a*b = c and outputs -1 otherwise. ;; ;; Date Written: 2008/02/13 ;; Author: SS allocate-registers a, b, c ; input registers allocate-registers prod, check ; temporary registers allocate-registers else ; label register read a ; first input number read b ; second input number read c ; third input number mul prod, a, b seq check, prod, c li else, Lelse jeqz check, else write check halt Lelse: li check, -1 write check halt