initial
[fpgammix.git] / workloads / myfib-verbose.mms
blob50d1aca21bacd9ae4a6a4a24723bab1e5a650605
1 * Fibonacci subroutines (exercise 1.4.1--13)
3 IOSPACE GREG
4 C       GREG
5 tmp     GREG
7         LOC     #100
8 Main    SETH    IOSPACE,1
9         SETL    C,'B'; PUSHJ $0,Putch
10         SETL    C,'E'; PUSHJ $0,Putch
11         SETL    C,'G'; PUSHJ $0,Putch
12         SETL    C,'I'; PUSHJ $0,Putch
13         SETL    C,'N'; PUSHJ $0,Putch
14         SETL    C,13;  PUSHJ $0,Putch
15         SETL    C,10;  PUSHJ $0,Putch
16         SET     $1,7
18         PUSHJ   $0,Fib
19         ADDU    C,$0,'A'; PUSHJ $0,Putch
20         TRAP    0,0
22 Fib     CMP     $1,$0,2
23         PBN     $1,1F
24         GET     $1,rJ
25         ADDU    C,$0,'0'; PUSHJ $2,Putch
26         SUB     $3,$0,1
27         PUSHJ   $2,Fib   $2=F_{n-1}
28         SUB     $4,$0,2
29         PUSHJ   $3,Fib   $3=F_{n-2}
30         ADDU    $0,$2,$3
31         PUT     rJ,$1
32 1H      POP     1,0
34 Putch   LDO     tmp,IOSPACE
35         PBOD    tmp,Putch
36         STBU    C,IOSPACE
37         POP     0,0