-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpasm.pasm
350 lines (348 loc) · 4.93 KB
/
pasm.pasm
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
def "null";
def "iadd";
def "isub";
def "imul";
def "idiv";
def "imod";
def "fadd";
def "fsub";
def "fmul";
def "fdiv";
def "fmod";
def "sadd";
def "iequal";
def "fequal";
def "sequal";
def "Not";
def "Or";
def "And";
def "i_greater";
def "i_less";
def "f_greater";
def "f_less";
def "call";
def "call_method";
def "loop";
def "make_block_for_loop";
def "end_loop";
def "make_func";
def "push_fast";
def "push_const";
def "push_var";
def "dict_insert";
def "add_var";
def "print";
def "itof";
def "ftoi";
def "itos";
def "ftos";
def "pop";
def "change_var";
def "push_int_arr";
def "push_float_arr";
def "push_Array";
def "get_subscript";
def "push_item";
def "pop_item";
def "make_block";
def "end_block";
def "Return";
def "change_arr_var";
def "import_api";
def "get_api";
def "call_api";
def "close_api";
def "push_file_pointer";
def "getchar_from_file";
def "write_to_file";
def "close_file";
def "get_command_line_arg";
def "push_dict";
def "dict_find";
def "get_dict_subscript";
def "remove_dict";
def "Continue";
def "Break";
def "if_do";
def "end_if";
def "0x00";
def "0x01";
def "0x02";
def "0x03";
def "0x04";
def "0x05";
def "0x06";
def "0x07";
def "0x08";
def "0x09";
def "0x0a";
def "0x0b";
def "0x0c";
def "0x0d";
def "0x0e";
def "0x0f";
def "0x10";
def "0x11";
def "0x12";
def "0x13";
def "0x14";
def "0x15";
def "0x16";
def "0x17";
def "0x18";
def "0x19";
def "0x1a";
def "0x1b";
def "0x1c";
def "0x1d";
def "0x1e";
def "0x1f";
def "0x20";
def "0x21";
def "0x22";
def "0x23";
def "0x24";
def "0x25";
def "0x26";
def "0x27";
def "0x28";
def "0x29";
def "0x2a";
def "0x2b";
def "0x2c";
def "0x2d";
def "0x2e";
def "0x2f";
def "0x30";
def "0x31";
def "0x32";
def "0x33";
def "0x34";
def "0x35";
def "0x36";
def "0x37";
def "0x38";
def "0x39";
def "0x3a";
def "0x3b";
def "0x3c";
def "0x3d";
def "0x3e";
def "0x3f";
def "0x40";
def "0x41";
def "0x42";
push_dict;初始化映射表
push_const 0;
push_const 67;
dict_insert;
push_const 1;
push_const 68;
dict_insert;
push_const 2;
push_const 69;
dict_insert;
push_const 3;
push_const 70;
dict_insert;
push_const 4;
push_const 71;
dict_insert;
push_const 5;
push_const 72;
dict_insert;
push_const 6;
push_const 73;
dict_insert;
push_const 7;
push_const 74;
dict_insert;
push_const 8;
push_const 75;
dict_insert;
push_const 9;
push_const 76;
dict_insert;
push_const 10;
push_const 77;
dict_insert;
push_const 11;
push_const 78;
dict_insert;
push_const 12;
push_const 79;
dict_insert;
push_const 13;
push_const 80;
dict_insert;
push_const 14;
push_const 81;
dict_insert;
push_const 15;
push_const 82;
dict_insert;
push_const 16;
push_const 83;
dict_insert;
push_const 17;
push_const 84;
dict_insert;
push_const 18;
push_const 85;
dict_insert;
push_const 19;
push_const 86;
dict_insert;
push_const 20;
push_const 87;
dict_insert;
push_const 21;
push_const 88;
dict_insert;
push_const 22;
push_const 89;
dict_insert;
push_const 23;
push_const 90;
dict_insert;
push_const 24;
push_const 91;
dict_insert;
push_const 25;
push_const 92;
dict_insert;
push_const 26;
push_const 93;
dict_insert;
push_const 27;
push_const 94;
dict_insert;
push_const 28;
push_const 95;
dict_insert;
push_const 29;
push_const 96;
dict_insert;
push_const 30;
push_const 97;
dict_insert;
push_const 31;
push_const 98;
dict_insert;
push_const 32;
push_const 99;
dict_insert;
push_const 33;
push_const 100;
dict_insert;
push_const 34;
push_const 101;
dict_insert;
push_const 35;
push_const 102;
dict_insert;
push_const 36;
push_const 103;
dict_insert;
push_const 37;
push_const 104;
dict_insert;
push_const 38;
push_const 105;
dict_insert;
push_const 39;
push_const 106;
dict_insert;
push_const 40;
push_const 107;
dict_insert;
push_const 41;
push_const 108;
dict_insert;
push_const 42;
push_const 109;
dict_insert;
push_const 43;
push_const 110;
dict_insert;
push_const 44;
push_const 111;
dict_insert;
push_const 45;
push_const 112;
dict_insert;
push_const 46;
push_const 113;
dict_insert;
push_const 47;
push_const 114;
dict_insert;
push_const 48;
push_const 115;
dict_insert;
push_const 49;
push_const 116;
dict_insert;
push_const 50;
push_const 117;
dict_insert;
push_const 51;
push_const 118;
dict_insert;
push_const 52;
push_const 119;
dict_insert;
push_const 53;
push_const 120;
dict_insert;
push_const 54;
push_const 121;
dict_insert;
push_const 55;
push_const 122;
dict_insert;
push_const 56;
push_const 123;
dict_insert;
push_const 57;
push_const 124;
dict_insert;
push_const 58;
push_const 125;
dict_insert;
push_const 59;
push_const 126;
dict_insert;
push_const 60;
push_const 127;
dict_insert;
push_const 61;
push_const 128;
dict_insert;
push_const 62;
push_const 129;
dict_insert;
push_const 63;
push_const 130;
dict_insert;
push_const 64;
push_const 131;
dict_insert;
push_const 65;
push_const 132;
dict_insert;
push_const 66;
push_const 133;
dict_insert;
add_var;存储变量
def -1;134
def " ";135
push_const 135;
print;
push_fast 0;
get_command_line_arg;获取文件地址
push_fast "r";读模式
push_file_pointer;获取文件指针
add_var;存储变量(1)
push_var 1;
close_file;//关闭指针