-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.txt
162 lines (142 loc) · 1.29 KB
/
output.txt
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#source "small-input.txt"
' Invocation to the main function
call main
halt
#line 1
f:
' * Parameters
' * IntType a (offset 8)
' * RealType b (offset 4)
' * Local variables
enter 0
#line 2
' * Return
push bp
pushi 8
addi
loadi
pushi 1
addi
i2f
ret 4, 0, 6
#line 5
main:
' * Parameters
' * Local variables
' * RealType real (offset -4)
' * IntType integer (offset -6)
enter 6
#line 9
' * Assignment
push bp
pushi -6
addi
pushb 97
b2i
storei
#line 10
' * Assignment
push bp
pushi -4
addi
push bp
pushi -6
addi
loadi
i2f
storef
#line 12
' * Write
push bp
pushi -4
addi
loadf
f2i
pushi 1
addi
outi
#line 13
' * Write
pushb 97
b2i
push bp
pushi -6
addi
loadi
subi
outi
#line 14
' * Write
push bp
pushi -4
addi
loadf
f2i
pushb 97
b2i
divi
outi
#line 15
' * Write
pushb 97
b2i
pushb 98
b2i
muli
outi
#line 17
' * Write
pushb 97
b2i
pushb 97
b2i
eqi
outi
#line 17
' * Write
pushb 97
b2i
push bp
pushi -6
addi
loadi
gti
outi
#line 17
' * Write
push bp
pushi -6
addi
loadi
push bp
pushi -4
addi
loadf
f2i
lti
outi
#line 17
' * Write
pushb 97
b2i
push bp
pushi -4
addi
loadf
f2i
pushi 1
addi
nei
outi
#line 19
' * Write
push bp
pushi -6
addi
loadi
pushb 99
b2i
i2f
call f
outf
ret 0, 6, 0