Skip to content

Commit

Permalink
Optimise (?) multiplication implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
floehopper committed Jan 13, 2015
1 parent d8d5cb1 commit 2aa7605
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions projects/04/mult/Mult.asm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// set R2 to 0
@R2
M=0
(LOOP)
// jump to "end" if R0 is zero
@R0
D=M
(LOOP)
@END
D;JEQ
// add R1 to R2
Expand All @@ -22,7 +22,7 @@ D=M
M=D+M
// decrement R0
@R0
M=M-1
MD=M-1
// jump to "loop"
@LOOP
0;JMP
Expand Down
4 changes: 2 additions & 2 deletions projects/04/mult/Mult.hack
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
0000000000000010
1111000010001000
0000000000000000
1111110010001000
0000000000000010
1111110010011000
0000000000000100
1110101010000111
0000000000001110
1110101010000111

0 comments on commit 2aa7605

Please sign in to comment.