First develop commit. Adding all existing files.
This commit is contained in:
13
resources/TOY/powers2.toy
Normal file
13
resources/TOY/powers2.toy
Normal file
@@ -0,0 +1,13 @@
|
||||
program Powers of 2
|
||||
// Input: None
|
||||
// Output: Prints out the positive powers of 2
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
00: 0001 1
|
||||
|
||||
10: 8A00 RA <- mem[00] 1
|
||||
while (a != 0) {
|
||||
11: 9AFF write RA System.out.println(a)
|
||||
12: 1AAA RA <- RA + RA a = a + a
|
||||
13: DA11 if (RA > 0) goto 11 }
|
||||
14: 0000 halt
|
||||
Reference in New Issue
Block a user