File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,28 +44,28 @@ Enable the collaboration mode to work with others at the same time
4444```
4545; As long as the multiplier is not 0, continue with the program
4646tst 0
47- --jmp 4
47+ --jmp 3
4848hlt
4949
5050; Decrement the multiplier, done once per iteration
5151dec 0
5252
5353; Decrement the multiplicand until it's 0 and add its content onto registers 2 and 3
5454tst 1
55- --jmp 8
56- jmp 12
55+ --jmp 7
56+ jmp 11
5757dec 1
5858inc 2
5959inc 3
60- jmp 5
60+ jmp 4
6161
6262; Move the multiplicand, now stored in register 2, back to register 1
6363tst 2
64- --jmp 16
65- jmp 1
64+ --jmp 15
65+ jmp 0
6666; move complete, go to next iteration
67- jmp 1
67+ jmp 0
6868dec 2
6969inc 1
70- jmp 12
70+ jmp 11
7171```
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function update() {
8080 linenums . value = '' ;
8181
8282 // add line number for every line that is not empty
83- let counter = 1 ;
83+ let counter = 0 ;
8484 for ( let i = 0 ; i < lines . length ; i ++ ) {
8585 if ( lines [ i ] != '' && ! lines [ i ] . startsWith ( ';' ) ) {
8686 linenums . value += counter + '\n' ;
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ function executeLine() {
8383 // evaluate code
8484 switch ( cmd ) {
8585 case 'jmp' :
86- line = param - 1 ;
86+ line = param ;
8787 break ;
8888
8989 case 'tst' :
You can’t perform that action at this time.
0 commit comments