Changeset 30e6dbf0542a…
Parent 50e1a57a2f0c…
by Benjamin Pollack
Changes to one file · Browse files at 30e6dbf0542a Showing diff from parent 50e1a57a2f0c Diff from another changeset...
@@ -6,4 +6,22 @@ // Multiplies R0 and R1 and stores the result in R2.
// (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[3], respectively.)
-// Put your code here.
\ No newline at end of file+ // Put your code here.
+ @R2
+ M=0
+(loop)
+ @R0
+ D=M
+ @done
+ D;JEQ
+ @R0
+ MD=M-1
+ @R1
+ D=M
+ @R2
+ M=M+D
+ @loop
+ 0;JMP
+(done)
+ @done
+ 0;JMP
|
Loading...