-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfib.x.cod
More file actions
executable file
·68 lines (68 loc) · 798 Bytes
/
fib.x.cod
File metadata and controls
executable file
·68 lines (68 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
GOTO start<<1>>
LABEL Read
READ
RETURN
LABEL Write
LOAD 0 dummyFormal
WRITE
RETURN
LABEL start<<1>>
LIT 0 x
GOTO continue<<3>>
LABEL fib<<2>>
LOAD 0 n
LIT 1
BOP <=
FALSEBRANCH else<<4>>
LIT 1
RETURN fib<<2>>
POP 0
GOTO continue<<5>>
LABEL else<<4>>
LOAD 0 n
LIT 2
BOP ==
FALSEBRANCH else<<6>>
LIT 1
RETURN fib<<2>>
POP 0
GOTO continue<<7>>
LABEL else<<6>>
LOAD 0 n
LIT 2
BOP -
ARGS 1
CALL fib<<2>>
LOAD 0 n
LIT 1
BOP -
ARGS 1
CALL fib<<2>>
BOP +
RETURN fib<<2>>
POP 0
LABEL continue<<7>>
POP 0
LABEL continue<<5>>
POP 0
LIT 0 GRATIS-RETURN-VALUE
RETURN fib<<2>>
LABEL continue<<3>>
LIT 0 k
LIT 5
STORE 0 x
ARGS 0
CALL Read
ARGS 1
CALL fib<<2>>
ARGS 1
CALL Write
STORE 1 k
LIT 0 x
LIT 7
STORE 2 x
LIT 8
STORE 2 x
POP 1
POP 2
HALT