First develop commit. Adding all existing files.
This commit is contained in:
16
resources/TOY/fibonacci.toy
Normal file
16
resources/TOY/fibonacci.toy
Normal file
@@ -0,0 +1,16 @@
|
||||
program Fibonacci (print to stdout)
|
||||
// Input: None
|
||||
// Output: Prints positive fibonacci numbers to standard output.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
00: 0000 0
|
||||
01: 0001 1
|
||||
|
||||
10: 8A00 RA <- mem[00] a = 0
|
||||
11: 8B01 RB <- mem[01] b = 1
|
||||
while(a > 0) {
|
||||
12: 9AFF print RA System.out.println(a)
|
||||
13: 1AAB RA <- RA + RB a = a + b
|
||||
14: 2BAB RB <- RA - RB b = a - b
|
||||
15: DA12 if (RA > 0) goto 12 }
|
||||
16: 0000 halt
|
||||
Reference in New Issue
Block a user