initial
[fpgammix.git] / workloads / xx.mms
blob51fe84eab59c3847fb3d5a24063ad4ea49333640
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,12;  PUSHJ $0,Putch
15         JMP     Main
17         PUSHJ   $0,Fib
18         ADDU    C,$0,'A'; PUSHJ $0,Putch
19         JMP     Main
21 Fib     CMP     $1,$0,2
22         PBN     $1,1F
23         GET     $1,rJ
24         ADDU    C,$0,'0'; PUSHJ $2,Putch
25         SUB     $3,$0,1
26         PUSHJ   $2,Fib   $2=F_{n-1}
27         SUB     $4,$0,2
28         PUSHJ   $3,Fib   $3=F_{n-2}
29         ADDU    $0,$2,$3
30         PUT     rJ,$1
31 1H      POP     1,0
33 Putch   LDT     tmp,IOSPACE
34         PBOD    tmp,Putch
35         STBU    C,IOSPACE
36         POP     0,0