OpenCores
URL https://opencores.org/ocsvn/c16/c16/trunk

Subversion Repositories c16

[/] [c16/] [trunk/] [loader.asm] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jsauermann
IN_RX_DATA      = 0x00                  ;
2
IN_STATUS       = 0x01                  ;
3
 
4
MEMTOP          = 0x2000
5
 
6
OUT_TX_DATA     = 0x00                  ;
7
;---------------------------------------;
8
RELOC_SRC       = start+Cend_text-stack ;
9
;---------------------------------------;
10
                                        ;
11
        MOVE    #reloc_rr, RR           ;
12
        MOVE    RR, SP                  ;
13
        MOVE    #MEMTOP, LL             ; destination
14
reloc:                                  ;
15
        MOVE    (SP)+, RR               ; restore source
16
        MOVE    -(RR), -(LL)            ;
17
        MOVE    RR, -(SP)               ; save source
18
        SHI     RR, #start              ;
19
        JMP     RRNZ, reloc             ;
20
        MOVE    #stack, RR              ;
21
        MOVE    RR, SP                  ;
22
        CALL    Cmain                   ;
23
halt:                                   ;
24
        HALT                            ;
25
reloc_rr:                               ; source
26
        .WORD   RELOC_SRC               ;
27
;---------------------------------------;
28
start:                                  ;
29
        .OFFSET MEMTOP                  ;
30
stack:                                  ;
31
;---------------------------------------;
32
;;; { 0 FunctionDefinition
33
;;;   { 1 TypeName
34
;;;     { 2 TypeSpecifier (all)
35
;;;       spec = int (80000)
36
;;;     } 2 TypeSpecifier (all)
37
;;;     { 2 List
38
;;;       { 3 DeclItem
39
;;;         what = DECL_NAME
40
;;;         name = getchr
41
;;;       } 3 DeclItem
42
;;;     } 2 List
43
;;;   } 1 TypeName
44
;;;   { 1 List
45
;;;     { 2 DeclItem
46
;;;       what = DECL_NAME
47
;;;       name = getchr
48
;;;     } 2 DeclItem
49
;;;     { 2 DeclItem
50
;;;       what = DECL_FUN
51
;;;     } 2 DeclItem
52
;;;   } 1 List
53
Cgetchr:
54
;;;   { 1 CompoundStatement
55
;;;     { 2 List
56
;;;       { 3 while Statement
57
L2_loop_1:
58
;;;         { 4 ExpressionStatement
59
;;;         } 4 ExpressionStatement
60
L2_cont_1:
61
;;;         { 4 Expr ! r
62
;;;           { 5 Expr l & r
63
;;;             { 6 TypeName (internal)
64
;;;               { 7 TypeSpecifier (all)
65
;;;                 spec = int (80000)
66
;;;               } 7 TypeSpecifier (all)
67
;;;             } 6 TypeName (internal)
68
        IN   (IN_STATUS), RU
69
;--     l & r
70
        AND     RR, #0x0001
71
;;;           } 5 Expr l & r
72
;--     16 bit ! r
73
        LNOT    RR
74
;;;         } 4 Expr ! r
75
;--     branch_true
76
        JMP     RRNZ, L2_loop_1
77
L2_brk_2:
78
;;;       } 3 while Statement
79
;;;       { 3 ExpressionStatement
80
IN   (IN_RX_DATA), RU
81
;;;       } 3 ExpressionStatement
82
;;;     } 2 List
83 7 jsauermann
;--     pop 0 bytes
84 2 jsauermann
;;;   } 1 CompoundStatement
85
;--     ret
86
        RET
87
;;; ------------------------------------;
88 7 jsauermann
;;;   { 1 FunctionDefinition
89
;;;     { 2 TypeName
90
;;;       { 3 TypeSpecifier (all)
91
;;;         spec = void (10000)
92
;;;       } 3 TypeSpecifier (all)
93
;;;       { 3 List
94
;;;         { 4 DeclItem
95
;;;           what = DECL_NAME
96
;;;           name = putchr
97
;;;         } 4 DeclItem
98
;;;       } 3 List
99
;;;     } 2 TypeName
100 2 jsauermann
;;;     { 2 List
101
;;;       { 3 DeclItem
102
;;;         what = DECL_NAME
103
;;;         name = putchr
104
;;;       } 3 DeclItem
105 7 jsauermann
;;;       { 3 DeclItem
106
;;;         what = DECL_FUN
107
;;;         { 4 List
108
;;;           { 5 ParameterDeclaration
109
;;;             isEllipsis = false
110
;;;             { 6 TypeName
111
;;;               { 7 TypeSpecifier (all)
112
;;;                 spec = char (20000)
113
;;;               } 7 TypeSpecifier (all)
114
;;;               { 7 List
115
;;;                 { 8 DeclItem
116
;;;                   what = DECL_NAME
117
;;;                   name = c
118
;;;                 } 8 DeclItem
119
;;;               } 7 List
120
;;;             } 6 TypeName
121
;;;           } 5 ParameterDeclaration
122
;;;         } 4 List
123
;;;       } 3 DeclItem
124 2 jsauermann
;;;     } 2 List
125
Cputchr:
126 7 jsauermann
;;;     { 2 CompoundStatement
127
;;;       { 3 List
128
;;;         { 4 while Statement
129 2 jsauermann
L3_loop_3:
130 7 jsauermann
;;;           { 5 ExpressionStatement
131
;;;           } 5 ExpressionStatement
132 2 jsauermann
L3_cont_3:
133 7 jsauermann
;;;           { 5 Expr l & r
134
;;;             { 6 TypeName (internal)
135
;;;               { 7 TypeSpecifier (all)
136
;;;                 spec = int (80000)
137
;;;               } 7 TypeSpecifier (all)
138
;;;             } 6 TypeName (internal)
139 2 jsauermann
        IN (IN_STATUS), RU
140
;--     l & r
141
        AND     RR, #0x0002
142 7 jsauermann
;;;           } 5 Expr l & r
143 2 jsauermann
;--     branch_true
144
        JMP     RRNZ, L3_loop_3
145
L3_brk_4:
146 7 jsauermann
;;;         } 4 while Statement
147
;;;         { 4 ExpressionStatement
148 2 jsauermann
        MOVE 2(SP), RU
149 7 jsauermann
;;;         } 4 ExpressionStatement
150
;;;         { 4 ExpressionStatement
151 2 jsauermann
        OUT  R, (OUT_TX_DATA)
152 7 jsauermann
;;;         } 4 ExpressionStatement
153
;;;       } 3 List
154
;--     pop 0 bytes
155
;;;     } 2 CompoundStatement
156 2 jsauermann
;--     ret
157
        RET
158
;;; ------------------------------------;
159 7 jsauermann
;;;     { 2 FunctionDefinition
160
;;;       { 3 TypeName
161
;;;         { 4 TypeSpecifier (all)
162
;;;           spec = void (10000)
163
;;;         } 4 TypeSpecifier (all)
164
;;;         { 4 List
165
;;;           { 5 DeclItem
166
;;;             what = DECL_NAME
167
;;;             name = print_string
168
;;;           } 5 DeclItem
169
;;;         } 4 List
170
;;;       } 3 TypeName
171
;;;       { 3 List
172
;;;         { 4 DeclItem
173
;;;           what = DECL_NAME
174
;;;           name = print_string
175
;;;         } 4 DeclItem
176
;;;         { 4 DeclItem
177
;;;           what = DECL_FUN
178
;;;           { 5 List
179 2 jsauermann
;;;             { 6 ParameterDeclaration
180
;;;               isEllipsis = false
181
;;;               { 7 TypeName
182
;;;                 { 8 TypeSpecifier (all)
183 7 jsauermann
;;;                   spec = const char (20100)
184 2 jsauermann
;;;                 } 8 TypeSpecifier (all)
185
;;;                 { 8 List
186
;;;                   { 9 DeclItem
187 7 jsauermann
;;;                     what = DECL_POINTER
188
;;;                     { 10 List
189
;;;                       { 11 Ptr
190
;;;                       } 11 Ptr
191
;;;                     } 10 List
192
;;;                   } 9 DeclItem
193
;;;                   { 9 DeclItem
194 2 jsauermann
;;;                     what = DECL_NAME
195 7 jsauermann
;;;                     name = buffer
196 2 jsauermann
;;;                   } 9 DeclItem
197
;;;                 } 8 List
198
;;;               } 7 TypeName
199
;;;             } 6 ParameterDeclaration
200 7 jsauermann
;;;           } 5 List
201
;;;         } 4 DeclItem
202
;;;       } 3 List
203
Cprint_string:
204
;;;       { 3 CompoundStatement
205
;;;         { 4 List
206
;;;           { 5 while Statement
207
;--     branch
208
        JMP     L4_cont_5
209
L4_loop_5:
210
;;;             { 6 ExpressionStatement
211
;;;               { 7 Expr l(r)
212
;;;                 { 8 TypeName
213
;;;                   { 9 TypeSpecifier (all)
214
;;;                     spec = void (10000)
215
;;;                   } 9 TypeSpecifier (all)
216
;;;                   { 9 List
217
;;;                     { 10 DeclItem
218
;;;                       what = DECL_NAME
219
;;;                       name = putchr
220
;;;                     } 10 DeclItem
221
;;;                   } 9 List
222
;;;                 } 8 TypeName
223
;;;                 { 8 ParameterDeclaration
224
;;;                   isEllipsis = false
225
;;;                   { 9 TypeName
226
;;;                     { 10 TypeSpecifier (all)
227
;;;                       spec = char (20000)
228
;;;                     } 10 TypeSpecifier (all)
229
;;;                     { 10 List
230
;;;                       { 11 DeclItem
231
;;;                         what = DECL_NAME
232
;;;                         name = c
233
;;;                       } 11 DeclItem
234
;;;                     } 10 List
235
;;;                   } 9 TypeName
236
;;;                 } 8 ParameterDeclaration
237
;;;                 { 8 Expr * r
238
;;;                   { 9 Expr l - r
239
;;;                     { 10 Expr ++r
240
;;;                       { 11 Expression (variable name)
241
;;;                         expr_type = "identifier" (buffer)
242 2 jsauermann
;--     load_rr_var buffer = 2(FP), SP at 0 (16 bit)
243
        MOVE    2(SP), RR
244 7 jsauermann
;;;                       } 11 Expression (variable name)
245 2 jsauermann
;--     ++
246
        ADD     RR, #0x0001
247
;--     store_rr_var buffer = 2(FP), SP at 0
248
        MOVE    RR, 2(SP)
249 7 jsauermann
;;;                     } 10 Expr ++r
250 2 jsauermann
;--     l - r
251
        SUB     RR, #0x0001
252 7 jsauermann
;;;                   } 9 Expr l - r
253 2 jsauermann
;--     content
254
        MOVE    (RR), RS
255 7 jsauermann
;;;                 } 8 Expr * r
256 2 jsauermann
;--     push_rr (8 bit)
257
        MOVE    R, -(SP)
258
;--     push 0 bytes
259
;--     call
260
        CALL    Cputchr
261
;--     pop 1 bytes
262
        ADD     SP, #1
263 7 jsauermann
;;;               } 7 Expr l(r)
264
;;;             } 6 ExpressionStatement
265 2 jsauermann
L4_cont_5:
266 7 jsauermann
;;;             { 6 Expr * r
267
;;;               { 7 Expression (variable name)
268
;;;                 expr_type = "identifier" (buffer)
269 2 jsauermann
;--     load_rr_var buffer = 2(FP), SP at 0 (16 bit)
270
        MOVE    2(SP), RR
271 7 jsauermann
;;;               } 7 Expression (variable name)
272 2 jsauermann
;--     content
273
        MOVE    (RR), RS
274 7 jsauermann
;;;             } 6 Expr * r
275 2 jsauermann
;--     branch_true
276
        JMP     RRNZ, L4_loop_5
277
L4_brk_6:
278 7 jsauermann
;;;           } 5 while Statement
279
;;;         } 4 List
280
;--     pop 0 bytes
281
;;;       } 3 CompoundStatement
282 2 jsauermann
;--     ret
283
        RET
284
;;; ------------------------------------;
285 7 jsauermann
;;;       { 3 FunctionDefinition
286 2 jsauermann
;;;         { 4 TypeName
287
;;;           { 5 TypeSpecifier (all)
288 7 jsauermann
;;;             spec = unsigned char (22000)
289 2 jsauermann
;;;           } 5 TypeSpecifier (all)
290
;;;           { 5 List
291
;;;             { 6 DeclItem
292
;;;               what = DECL_NAME
293 7 jsauermann
;;;               name = get_nibble
294 2 jsauermann
;;;             } 6 DeclItem
295
;;;           } 5 List
296
;;;         } 4 TypeName
297 7 jsauermann
;;;         { 4 List
298
;;;           { 5 DeclItem
299
;;;             what = DECL_NAME
300
;;;             name = get_nibble
301
;;;           } 5 DeclItem
302
;;;           { 5 DeclItem
303
;;;             what = DECL_FUN
304
;;;           } 5 DeclItem
305
;;;         } 4 List
306
Cget_nibble:
307
;;;         { 4 CompoundStatement
308
;;;           { 5 InitDeclarator
309
;;;             { 6 List
310
;;;               { 7 DeclItem
311
;;;                 what = DECL_NAME
312
;;;                 name = c
313
;;;               } 7 DeclItem
314
;;;             } 6 List
315
;;;             { 6 Initializer (skalar)
316
;;;               { 7 Expr l(r)
317
;;;                 { 8 TypeName
318
;;;                   { 9 TypeSpecifier (all)
319
;;;                     spec = int (80000)
320
;;;                   } 9 TypeSpecifier (all)
321
;;;                   { 9 List
322
;;;                     { 10 DeclItem
323
;;;                       what = DECL_NAME
324
;;;                       name = getchr
325
;;;                     } 10 DeclItem
326
;;;                   } 9 List
327
;;;                 } 8 TypeName
328 2 jsauermann
;--     push 2 bytes
329
;--     call
330
        CALL    Cgetchr
331
;--     pop 0 bytes
332 7 jsauermann
;;;               } 7 Expr l(r)
333 2 jsauermann
;--     push_rr (8 bit)
334
        MOVE    R, -(SP)
335 7 jsauermann
;;;             } 6 Initializer (skalar)
336
;;;           } 5 InitDeclarator
337
;;;           { 5 List
338
;;;             { 6 IfElseStatement
339
;;;               { 7 Expr l < r
340
;;;                 { 8 TypeName (internal)
341
;;;                   { 9 TypeSpecifier (all)
342
;;;                     spec = unsigned int (82000)
343
;;;                   } 9 TypeSpecifier (all)
344
;;;                 } 8 TypeName (internal)
345
;;;                 { 8 Expression (variable name)
346
;;;                   expr_type = "identifier" (c)
347 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
348
        MOVE    0(SP), RU
349 7 jsauermann
;;;                 } 8 Expression (variable name)
350 2 jsauermann
;--     l < r
351
        SLO     RR, #0x0030
352 7 jsauermann
;;;               } 7 Expr l < r
353 2 jsauermann
;--     branch_false
354
        JMP     RRZ, L5_endif_7
355 7 jsauermann
;;;               { 7 return Statement
356
;;;                 { 8 NumericExpression (constant 255 = 0xFF)
357 2 jsauermann
;--     load_rr_constant
358
        MOVE    #0x00FF, RR
359 7 jsauermann
;;;                 } 8 NumericExpression (constant 255 = 0xFF)
360
;--     ret
361
        ADD     SP, #1
362
        RET
363
;;;               } 7 return Statement
364 2 jsauermann
L5_endif_7:
365 7 jsauermann
;;;             } 6 IfElseStatement
366
;;;             { 6 IfElseStatement
367
;;;               { 7 Expr l <= r
368
;;;                 { 8 TypeName (internal)
369
;;;                   { 9 TypeSpecifier (all)
370
;;;                     spec = unsigned int (82000)
371
;;;                   } 9 TypeSpecifier (all)
372
;;;                 } 8 TypeName (internal)
373
;;;                 { 8 Expression (variable name)
374
;;;                   expr_type = "identifier" (c)
375 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
376
        MOVE    0(SP), RU
377 7 jsauermann
;;;                 } 8 Expression (variable name)
378 2 jsauermann
;--     l <= r
379
        SLS     RR, #0x0039
380 7 jsauermann
;;;               } 7 Expr l <= r
381 2 jsauermann
;--     branch_false
382
        JMP     RRZ, L5_endif_8
383 7 jsauermann
;;;               { 7 return Statement
384
;;;                 { 8 Expr l - r
385
;;;                   { 9 Expression (variable name)
386
;;;                     expr_type = "identifier" (c)
387 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
388
        MOVE    0(SP), RU
389 7 jsauermann
;;;                   } 9 Expression (variable name)
390 2 jsauermann
;--     l - r
391
        SUB     RR, #0x0030
392 7 jsauermann
;;;                 } 8 Expr l - r
393
;--     ret
394
        ADD     SP, #1
395
        RET
396
;;;               } 7 return Statement
397 2 jsauermann
L5_endif_8:
398 7 jsauermann
;;;             } 6 IfElseStatement
399
;;;             { 6 IfElseStatement
400
;;;               { 7 Expr l < r
401
;;;                 { 8 TypeName (internal)
402
;;;                   { 9 TypeSpecifier (all)
403
;;;                     spec = unsigned int (82000)
404
;;;                   } 9 TypeSpecifier (all)
405
;;;                 } 8 TypeName (internal)
406
;;;                 { 8 Expression (variable name)
407
;;;                   expr_type = "identifier" (c)
408 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
409
        MOVE    0(SP), RU
410 7 jsauermann
;;;                 } 8 Expression (variable name)
411 2 jsauermann
;--     l < r
412
        SLO     RR, #0x0041
413 7 jsauermann
;;;               } 7 Expr l < r
414 2 jsauermann
;--     branch_false
415
        JMP     RRZ, L5_endif_9
416 7 jsauermann
;;;               { 7 return Statement
417
;;;                 { 8 NumericExpression (constant 255 = 0xFF)
418 2 jsauermann
;--     load_rr_constant
419
        MOVE    #0x00FF, RR
420 7 jsauermann
;;;                 } 8 NumericExpression (constant 255 = 0xFF)
421
;--     ret
422
        ADD     SP, #1
423
        RET
424
;;;               } 7 return Statement
425 2 jsauermann
L5_endif_9:
426 7 jsauermann
;;;             } 6 IfElseStatement
427
;;;             { 6 IfElseStatement
428
;;;               { 7 Expr l <= r
429
;;;                 { 8 TypeName (internal)
430
;;;                   { 9 TypeSpecifier (all)
431
;;;                     spec = unsigned int (82000)
432
;;;                   } 9 TypeSpecifier (all)
433
;;;                 } 8 TypeName (internal)
434
;;;                 { 8 Expression (variable name)
435
;;;                   expr_type = "identifier" (c)
436 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
437
        MOVE    0(SP), RU
438 7 jsauermann
;;;                 } 8 Expression (variable name)
439 2 jsauermann
;--     l <= r
440
        SLS     RR, #0x0046
441 7 jsauermann
;;;               } 7 Expr l <= r
442 2 jsauermann
;--     branch_false
443
        JMP     RRZ, L5_endif_10
444 7 jsauermann
;;;               { 7 return Statement
445
;;;                 { 8 Expr l - r
446
;;;                   { 9 Expression (variable name)
447
;;;                     expr_type = "identifier" (c)
448 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
449
        MOVE    0(SP), RU
450 7 jsauermann
;;;                   } 9 Expression (variable name)
451 2 jsauermann
;--     l - r
452
        SUB     RR, #0x0037
453 7 jsauermann
;;;                 } 8 Expr l - r
454
;--     ret
455
        ADD     SP, #1
456
        RET
457
;;;               } 7 return Statement
458 2 jsauermann
L5_endif_10:
459 7 jsauermann
;;;             } 6 IfElseStatement
460
;;;             { 6 IfElseStatement
461
;;;               { 7 Expr l < r
462
;;;                 { 8 TypeName (internal)
463
;;;                   { 9 TypeSpecifier (all)
464
;;;                     spec = unsigned int (82000)
465
;;;                   } 9 TypeSpecifier (all)
466
;;;                 } 8 TypeName (internal)
467
;;;                 { 8 Expression (variable name)
468
;;;                   expr_type = "identifier" (c)
469 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
470
        MOVE    0(SP), RU
471 7 jsauermann
;;;                 } 8 Expression (variable name)
472 2 jsauermann
;--     l < r
473
        SLO     RR, #0x0061
474 7 jsauermann
;;;               } 7 Expr l < r
475 2 jsauermann
;--     branch_false
476
        JMP     RRZ, L5_endif_11
477 7 jsauermann
;;;               { 7 return Statement
478
;;;                 { 8 NumericExpression (constant 255 = 0xFF)
479 2 jsauermann
;--     load_rr_constant
480
        MOVE    #0x00FF, RR
481 7 jsauermann
;;;                 } 8 NumericExpression (constant 255 = 0xFF)
482
;--     ret
483
        ADD     SP, #1
484
        RET
485
;;;               } 7 return Statement
486 2 jsauermann
L5_endif_11:
487 7 jsauermann
;;;             } 6 IfElseStatement
488
;;;             { 6 IfElseStatement
489
;;;               { 7 Expr l <= r
490
;;;                 { 8 TypeName (internal)
491
;;;                   { 9 TypeSpecifier (all)
492
;;;                     spec = unsigned int (82000)
493
;;;                   } 9 TypeSpecifier (all)
494
;;;                 } 8 TypeName (internal)
495
;;;                 { 8 Expression (variable name)
496
;;;                   expr_type = "identifier" (c)
497 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
498
        MOVE    0(SP), RU
499 7 jsauermann
;;;                 } 8 Expression (variable name)
500 2 jsauermann
;--     l <= r
501
        SLS     RR, #0x0066
502 7 jsauermann
;;;               } 7 Expr l <= r
503 2 jsauermann
;--     branch_false
504
        JMP     RRZ, L5_endif_12
505 7 jsauermann
;;;               { 7 return Statement
506
;;;                 { 8 Expr l - r
507
;;;                   { 9 Expression (variable name)
508
;;;                     expr_type = "identifier" (c)
509 2 jsauermann
;--     load_rr_var c = -1(FP), SP at -1 (8 bit)
510
        MOVE    0(SP), RU
511 7 jsauermann
;;;                   } 9 Expression (variable name)
512 2 jsauermann
;--     l - r
513
        SUB     RR, #0x0057
514 7 jsauermann
;;;                 } 8 Expr l - r
515
;--     ret
516
        ADD     SP, #1
517
        RET
518
;;;               } 7 return Statement
519 2 jsauermann
L5_endif_12:
520 7 jsauermann
;;;             } 6 IfElseStatement
521
;;;             { 6 return Statement
522
;;;               { 7 NumericExpression (constant 255 = 0xFF)
523 2 jsauermann
;--     load_rr_constant
524
        MOVE    #0x00FF, RR
525 7 jsauermann
;;;               } 7 NumericExpression (constant 255 = 0xFF)
526 2 jsauermann
;--     ret
527 7 jsauermann
        ADD     SP, #1
528
        RET
529
;;;             } 6 return Statement
530
;;;           } 5 List
531 2 jsauermann
;--     pop 1 bytes
532
        ADD     SP, #1
533 7 jsauermann
;;;         } 4 CompoundStatement
534
;--     ret
535 2 jsauermann
        RET
536
;;; ------------------------------------;
537 7 jsauermann
;;;         { 4 FunctionDefinition
538
;;;           { 5 TypeName
539
;;;             { 6 TypeSpecifier (all)
540
;;;               spec = int (80000)
541
;;;             } 6 TypeSpecifier (all)
542
;;;             { 6 List
543
;;;               { 7 DeclItem
544
;;;                 what = DECL_NAME
545
;;;                 name = get_byte
546
;;;               } 7 DeclItem
547
;;;             } 6 List
548
;;;           } 5 TypeName
549 2 jsauermann
;;;           { 5 List
550
;;;             { 6 DeclItem
551
;;;               what = DECL_NAME
552 7 jsauermann
;;;               name = get_byte
553 2 jsauermann
;;;             } 6 DeclItem
554 7 jsauermann
;;;             { 6 DeclItem
555
;;;               what = DECL_FUN
556
;;;             } 6 DeclItem
557 2 jsauermann
;;;           } 5 List
558 7 jsauermann
Cget_byte:
559
;;;           { 5 CompoundStatement
560
;;;             { 6 InitDeclarator
561
;;;               { 7 List
562
;;;                 { 8 DeclItem
563
;;;                   what = DECL_NAME
564
;;;                   name = hi
565
;;;                 } 8 DeclItem
566
;;;               } 7 List
567
;;;               { 7 Initializer (skalar)
568
;;;                 { 8 Expr l(r)
569
;;;                   { 9 TypeName
570
;;;                     { 10 TypeSpecifier (all)
571
;;;                       spec = unsigned char (22000)
572
;;;                     } 10 TypeSpecifier (all)
573
;;;                     { 10 List
574
;;;                       { 11 DeclItem
575
;;;                         what = DECL_NAME
576
;;;                         name = get_nibble
577
;;;                       } 11 DeclItem
578
;;;                     } 10 List
579
;;;                   } 9 TypeName
580 2 jsauermann
;--     push 1 bytes
581
;--     call
582
        CALL    Cget_nibble
583
;--     pop 0 bytes
584 7 jsauermann
;;;                 } 8 Expr l(r)
585 2 jsauermann
;--     push_rr (8 bit)
586
        MOVE    R, -(SP)
587 7 jsauermann
;;;               } 7 Initializer (skalar)
588
;;;             } 6 InitDeclarator
589
;;;             { 6 InitDeclarator
590
;;;               { 7 List
591
;;;                 { 8 DeclItem
592
;;;                   what = DECL_NAME
593
;;;                   name = lo
594
;;;                 } 8 DeclItem
595
;;;               } 7 List
596 2 jsauermann
;--     push_zero 1 bytes
597
        CLRB    -(SP)
598 7 jsauermann
;;;             } 6 InitDeclarator
599
;;;             { 6 List
600
;;;               { 7 IfElseStatement
601
;;;                 { 8 Expr l != r
602
;;;                   { 9 TypeName (internal)
603
;;;                     { 10 TypeSpecifier (all)
604
;;;                       spec = unsigned int (82000)
605
;;;                     } 10 TypeSpecifier (all)
606
;;;                   } 9 TypeName (internal)
607
;;;                   { 9 Expression (variable name)
608
;;;                     expr_type = "identifier" (hi)
609 2 jsauermann
;--     load_rr_var hi = -1(FP), SP at -2 (8 bit)
610
        MOVE    1(SP), RU
611 7 jsauermann
;;;                   } 9 Expression (variable name)
612 2 jsauermann
;--     l != r
613
        SNE     RR, #0x00FF
614 7 jsauermann
;;;                 } 8 Expr l != r
615 2 jsauermann
;--     branch_false
616
        JMP     RRZ, L6_endif_13
617 7 jsauermann
;;;                 { 8 CompoundStatement
618
;;;                   { 9 List
619
;;;                     { 10 ExpressionStatement
620
;;;                       { 11 Expr l = r
621
;;;                         { 12 TypeName
622
;;;                           { 13 TypeSpecifier (all)
623
;;;                             spec = unsigned char (22000)
624
;;;                           } 13 TypeSpecifier (all)
625
;;;                           { 13 List
626
;;;                             { 14 DeclItem
627
;;;                               what = DECL_NAME
628
;;;                               name = lo
629
;;;                             } 14 DeclItem
630
;;;                           } 13 List
631
;;;                         } 12 TypeName
632
;;;                         { 12 Expr l(r)
633
;;;                           { 13 TypeName
634
;;;                             { 14 TypeSpecifier (all)
635
;;;                               spec = unsigned char (22000)
636
;;;                             } 14 TypeSpecifier (all)
637
;;;                             { 14 List
638
;;;                               { 15 DeclItem
639
;;;                                 what = DECL_NAME
640
;;;                                 name = get_nibble
641
;;;                               } 15 DeclItem
642
;;;                             } 14 List
643
;;;                           } 13 TypeName
644 2 jsauermann
;--     push 1 bytes
645
;--     call
646
        CALL    Cget_nibble
647
;--     pop 0 bytes
648 7 jsauermann
;;;                         } 12 Expr l(r)
649 2 jsauermann
;--     store_rr_var lo = -2(FP), SP at -2
650
        MOVE    R, 0(SP)
651 7 jsauermann
;;;                       } 11 Expr l = r
652
;;;                     } 10 ExpressionStatement
653
;;;                     { 10 IfElseStatement
654
;;;                       { 11 Expr l != r
655
;;;                         { 12 TypeName (internal)
656
;;;                           { 13 TypeSpecifier (all)
657
;;;                             spec = unsigned int (82000)
658
;;;                           } 13 TypeSpecifier (all)
659
;;;                         } 12 TypeName (internal)
660
;;;                         { 12 Expression (variable name)
661
;;;                           expr_type = "identifier" (lo)
662 2 jsauermann
;--     load_rr_var lo = -2(FP), SP at -2 (8 bit)
663
        MOVE    0(SP), RU
664 7 jsauermann
;;;                         } 12 Expression (variable name)
665 2 jsauermann
;--     l != r
666
        SNE     RR, #0x00FF
667 7 jsauermann
;;;                       } 11 Expr l != r
668 2 jsauermann
;--     branch_false
669
        JMP     RRZ, L6_endif_14
670 7 jsauermann
;;;                       { 11 return Statement
671
;;;                         { 12 Expr l | r
672
;;;                           { 13 TypeName (internal)
673
;;;                             { 14 TypeSpecifier (all)
674
;;;                               spec = unsigned int (82000)
675
;;;                             } 14 TypeSpecifier (all)
676
;;;                           } 13 TypeName (internal)
677
;;;                           { 13 Expr l << r
678
;;;                             { 14 TypeName (internal)
679
;;;                               { 15 TypeSpecifier (all)
680
;;;                                 spec = int (80000)
681
;;;                               } 15 TypeSpecifier (all)
682
;;;                             } 14 TypeName (internal)
683
;;;                             { 14 Expression (variable name)
684
;;;                               expr_type = "identifier" (hi)
685 2 jsauermann
;--     load_rr_var hi = -1(FP), SP at -2 (8 bit)
686
        MOVE    1(SP), RU
687 7 jsauermann
;;;                             } 14 Expression (variable name)
688 2 jsauermann
;--     l << r
689
        LSL     RR, #0x0004
690 7 jsauermann
;;;                           } 13 Expr l << r
691 2 jsauermann
;--     move_rr_to_ll
692
        MOVE    RR, LL
693 7 jsauermann
;;;                           { 13 Expression (variable name)
694
;;;                             expr_type = "identifier" (lo)
695 2 jsauermann
;--     load_rr_var lo = -2(FP), SP at -2 (8 bit)
696
        MOVE    0(SP), RU
697 7 jsauermann
;;;                           } 13 Expression (variable name)
698 2 jsauermann
;--     l | r
699
        OR      LL, RR
700 7 jsauermann
;;;                         } 12 Expr l | r
701
;--     ret
702
        ADD     SP, #2
703
        RET
704
;;;                       } 11 return Statement
705 2 jsauermann
L6_endif_14:
706 7 jsauermann
;;;                     } 10 IfElseStatement
707
;;;                   } 9 List
708
;--     pop 0 bytes
709
;;;                 } 8 CompoundStatement
710 2 jsauermann
L6_endif_13:
711 7 jsauermann
;;;               } 7 IfElseStatement
712
;;;               { 7 ExpressionStatement
713
;;;                 { 8 Expr l(r)
714
;;;                   { 9 TypeName
715
;;;                     { 10 TypeSpecifier (all)
716
;;;                       spec = void (10000)
717
;;;                     } 10 TypeSpecifier (all)
718
;;;                     { 10 List
719
;;;                       { 11 DeclItem
720
;;;                         what = DECL_NAME
721
;;;                         name = print_string
722
;;;                       } 11 DeclItem
723
;;;                     } 10 List
724
;;;                   } 9 TypeName
725
;;;                   { 9 ParameterDeclaration
726
;;;                     isEllipsis = false
727
;;;                     { 10 TypeName
728
;;;                       { 11 TypeSpecifier (all)
729
;;;                         spec = const char (20100)
730
;;;                       } 11 TypeSpecifier (all)
731
;;;                       { 11 List
732
;;;                         { 12 DeclItem
733
;;;                           what = DECL_POINTER
734
;;;                           { 13 List
735
;;;                             { 14 Ptr
736
;;;                             } 14 Ptr
737
;;;                           } 13 List
738
;;;                         } 12 DeclItem
739
;;;                         { 12 DeclItem
740
;;;                           what = DECL_NAME
741
;;;                           name = buffer
742
;;;                         } 12 DeclItem
743
;;;                       } 11 List
744
;;;                     } 10 TypeName
745
;;;                   } 9 ParameterDeclaration
746
;;;                   { 9 StringExpression
747 2 jsauermann
;--     load_rr_string
748
        MOVE    #Cstr_5, RR
749 7 jsauermann
;;;                   } 9 StringExpression
750 2 jsauermann
;--     push_rr (16 bit)
751
        MOVE    RR, -(SP)
752
;--     push 0 bytes
753
;--     call
754
        CALL    Cprint_string
755
;--     pop 2 bytes
756
        ADD     SP, #2
757 7 jsauermann
;;;                 } 8 Expr l(r)
758
;;;               } 7 ExpressionStatement
759
;;;               { 7 ExpressionStatement
760 2 jsauermann
        HALT
761 7 jsauermann
;;;               } 7 ExpressionStatement
762
;;;             } 6 List
763 2 jsauermann
;--     pop 2 bytes
764
        ADD     SP, #2
765 7 jsauermann
;;;           } 5 CompoundStatement
766
;--     ret
767 2 jsauermann
        RET
768
;;; ------------------------------------;
769 7 jsauermann
;;;           { 5 FunctionDefinition
770
;;;             { 6 TypeName
771
;;;               { 7 TypeSpecifier (all)
772
;;;                 spec = int (80000)
773
;;;               } 7 TypeSpecifier (all)
774
;;;               { 7 List
775
;;;                 { 8 DeclItem
776
;;;                   what = DECL_NAME
777
;;;                   name = main
778
;;;                 } 8 DeclItem
779
;;;               } 7 List
780
;;;             } 6 TypeName
781 2 jsauermann
;;;             { 6 List
782
;;;               { 7 DeclItem
783
;;;                 what = DECL_NAME
784 7 jsauermann
;;;                 name = main
785 2 jsauermann
;;;               } 7 DeclItem
786
;;;               { 7 DeclItem
787 7 jsauermann
;;;                 what = DECL_FUN
788
;;;                 { 8 List
789
;;;                   { 9 ParameterDeclaration
790
;;;                     isEllipsis = false
791
;;;                     { 10 TypeName
792
;;;                       { 11 TypeSpecifier (all)
793
;;;                         spec = int (80000)
794
;;;                       } 11 TypeSpecifier (all)
795
;;;                       { 11 List
796
;;;                         { 12 DeclItem
797
;;;                           what = DECL_NAME
798
;;;                           name = argc
799
;;;                         } 12 DeclItem
800
;;;                       } 11 List
801
;;;                     } 10 TypeName
802
;;;                   } 9 ParameterDeclaration
803
;;;                   { 9 ParameterDeclaration
804
;;;                     isEllipsis = false
805
;;;                     { 10 TypeName
806
;;;                       { 11 TypeSpecifier (all)
807
;;;                         spec = char (20000)
808
;;;                       } 11 TypeSpecifier (all)
809
;;;                       { 11 List
810
;;;                         { 12 DeclItem
811
;;;                           what = DECL_POINTER
812
;;;                           { 13 List
813
;;;                             { 14 Ptr
814
;;;                             } 14 Ptr
815
;;;                           } 13 List
816
;;;                         } 12 DeclItem
817
;;;                         { 12 DeclItem
818
;;;                           what = DECL_NAME
819
;;;                           name = argv
820
;;;                         } 12 DeclItem
821
;;;                         { 12 DeclItem
822
;;;                           what = DECL_ARRAY
823
;;;                         } 12 DeclItem
824
;;;                       } 11 List
825
;;;                     } 10 TypeName
826
;;;                   } 9 ParameterDeclaration
827
;;;                 } 8 List
828 2 jsauermann
;;;               } 7 DeclItem
829
;;;             } 6 List
830
Cmain:
831 7 jsauermann
;;;             { 6 CompoundStatement
832
;;;               { 7 InitDeclarator
833
;;;                 { 8 List
834
;;;                   { 9 DeclItem
835
;;;                     what = DECL_NAME
836
;;;                     name = record_length
837
;;;                   } 9 DeclItem
838
;;;                 } 8 List
839 2 jsauermann
;--     push_zero 1 bytes
840
        CLRB    -(SP)
841 7 jsauermann
;;;               } 7 InitDeclarator
842
;;;               { 7 InitDeclarator
843
;;;                 { 8 List
844
;;;                   { 9 DeclItem
845
;;;                     what = DECL_NAME
846
;;;                     name = address
847
;;;                   } 9 DeclItem
848
;;;                 } 8 List
849 2 jsauermann
;--     push_zero 2 bytes
850
        CLRW    -(SP)
851 7 jsauermann
;;;               } 7 InitDeclarator
852
;;;               { 7 InitDeclarator
853
;;;                 { 8 List
854
;;;                   { 9 DeclItem
855
;;;                     what = DECL_NAME
856
;;;                     name = record_type
857
;;;                   } 9 DeclItem
858
;;;                 } 8 List
859 2 jsauermann
;--     push_zero 1 bytes
860
        CLRB    -(SP)
861 7 jsauermann
;;;               } 7 InitDeclarator
862
;;;               { 7 InitDeclarator
863
;;;                 { 8 List
864
;;;                   { 9 DeclItem
865
;;;                     what = DECL_NAME
866
;;;                     name = check_sum
867
;;;                   } 9 DeclItem
868
;;;                 } 8 List
869 2 jsauermann
;--     push_zero 1 bytes
870
        CLRB    -(SP)
871 7 jsauermann
;;;               } 7 InitDeclarator
872
;;;               { 7 InitDeclarator
873
;;;                 { 8 List
874
;;;                   { 9 DeclItem
875
;;;                     what = DECL_NAME
876
;;;                     name = i
877
;;;                   } 9 DeclItem
878
;;;                 } 8 List
879 2 jsauermann
;--     push_zero 1 bytes
880
        CLRB    -(SP)
881 7 jsauermann
;;;               } 7 InitDeclarator
882
;;;               { 7 InitDeclarator
883
;;;                 { 8 List
884
;;;                   { 9 DeclItem
885
;;;                     what = DECL_NAME
886
;;;                     name = c
887
;;;                   } 9 DeclItem
888
;;;                 } 8 List
889 2 jsauermann
;--     push_zero 1 bytes
890
        CLRB    -(SP)
891 7 jsauermann
;;;               } 7 InitDeclarator
892
;;;               { 7 List
893
;;;                 { 8 for Statement
894
;;;                   { 9 ExpressionStatement
895
;;;                   } 9 ExpressionStatement
896 2 jsauermann
L7_loop_15:
897 7 jsauermann
;;;                   { 9 CompoundStatement
898
;;;                     { 10 List
899
;;;                       { 11 ExpressionStatement
900
;;;                         { 12 Expr l(r)
901
;;;                           { 13 TypeName
902
;;;                             { 14 TypeSpecifier (all)
903
;;;                               spec = void (10000)
904
;;;                             } 14 TypeSpecifier (all)
905
;;;                             { 14 List
906
;;;                               { 15 DeclItem
907
;;;                                 what = DECL_NAME
908
;;;                                 name = print_string
909
;;;                               } 15 DeclItem
910
;;;                             } 14 List
911
;;;                           } 13 TypeName
912
;;;                           { 13 ParameterDeclaration
913
;;;                             isEllipsis = false
914
;;;                             { 14 TypeName
915
;;;                               { 15 TypeSpecifier (all)
916
;;;                                 spec = const char (20100)
917
;;;                               } 15 TypeSpecifier (all)
918
;;;                               { 15 List
919
;;;                                 { 16 DeclItem
920
;;;                                   what = DECL_POINTER
921
;;;                                   { 17 List
922
;;;                                     { 18 Ptr
923
;;;                                     } 18 Ptr
924
;;;                                   } 17 List
925
;;;                                 } 16 DeclItem
926
;;;                                 { 16 DeclItem
927
;;;                                   what = DECL_NAME
928
;;;                                   name = buffer
929
;;;                                 } 16 DeclItem
930
;;;                               } 15 List
931
;;;                             } 14 TypeName
932
;;;                           } 13 ParameterDeclaration
933
;;;                           { 13 StringExpression
934 2 jsauermann
;--     load_rr_string
935
        MOVE    #Cstr_7, RR
936 7 jsauermann
;;;                           } 13 StringExpression
937 2 jsauermann
;--     push_rr (16 bit)
938
        MOVE    RR, -(SP)
939
;--     push 0 bytes
940
;--     call
941
        CALL    Cprint_string
942
;--     pop 2 bytes
943
        ADD     SP, #2
944 7 jsauermann
;;;                         } 12 Expr l(r)
945
;;;                       } 11 ExpressionStatement
946
;;;                       { 11 for Statement
947
;;;                         { 12 ExpressionStatement
948
;;;                         } 12 ExpressionStatement
949 2 jsauermann
L7_loop_17:
950 7 jsauermann
;;;                         { 12 CompoundStatement
951
;;;                           { 13 List
952
;;;                             { 14 while Statement
953 2 jsauermann
L7_loop_19:
954 7 jsauermann
;;;                               { 15 ExpressionStatement
955
;;;                               } 15 ExpressionStatement
956 2 jsauermann
L7_cont_19:
957 7 jsauermann
;;;                               { 15 Expr l != r
958
;;;                                 { 16 TypeName (internal)
959
;;;                                   { 17 TypeSpecifier (all)
960
;;;                                     spec = unsigned int (82000)
961
;;;                                   } 17 TypeSpecifier (all)
962
;;;                                 } 16 TypeName (internal)
963
;;;                                 { 16 Expr l = r
964
;;;                                   { 17 TypeName
965
;;;                                     { 18 TypeSpecifier (all)
966
;;;                                       spec = unsigned char (22000)
967
;;;                                     } 18 TypeSpecifier (all)
968
;;;                                     { 18 List
969
;;;                                       { 19 DeclItem
970
;;;                                         what = DECL_NAME
971
;;;                                         name = c
972
;;;                                       } 19 DeclItem
973
;;;                                     } 18 List
974
;;;                                   } 17 TypeName
975
;;;                                   { 17 Expr l(r)
976
;;;                                     { 18 TypeName
977
;;;                                       { 19 TypeSpecifier (all)
978
;;;                                         spec = int (80000)
979
;;;                                       } 19 TypeSpecifier (all)
980
;;;                                       { 19 List
981
;;;                                         { 20 DeclItem
982
;;;                                           what = DECL_NAME
983
;;;                                           name = getchr
984
;;;                                         } 20 DeclItem
985
;;;                                       } 19 List
986
;;;                                     } 18 TypeName
987 2 jsauermann
;--     push 2 bytes
988
;--     call
989
        CALL    Cgetchr
990
;--     pop 0 bytes
991 7 jsauermann
;;;                                   } 17 Expr l(r)
992 2 jsauermann
;--     store_rr_var c = -7(FP), SP at -7
993
        MOVE    R, 0(SP)
994 7 jsauermann
;;;                                 } 16 Expr l = r
995 2 jsauermann
;--     l != r
996
        SNE     RR, #0x003A
997 7 jsauermann
;;;                               } 15 Expr l != r
998 2 jsauermann
;--     branch_true
999
        JMP     RRNZ, L7_loop_19
1000
L7_brk_20:
1001 7 jsauermann
;;;                             } 14 while Statement
1002
;;;                             { 14 ExpressionStatement
1003
;;;                               { 15 Expr l = r
1004
;;;                                 { 16 TypeName
1005
;;;                                   { 17 TypeSpecifier (all)
1006
;;;                                     spec = unsigned char (22000)
1007
;;;                                   } 17 TypeSpecifier (all)
1008
;;;                                   { 17 List
1009
;;;                                     { 18 DeclItem
1010
;;;                                       what = DECL_NAME
1011
;;;                                       name = check_sum
1012
;;;                                     } 18 DeclItem
1013
;;;                                   } 17 List
1014
;;;                                 } 16 TypeName
1015
;;;                                 { 16 NumericExpression (constant 0 = 0x0)
1016 2 jsauermann
;--     load_rr_constant
1017
        MOVE    #0x0000, RR
1018 7 jsauermann
;;;                                 } 16 NumericExpression (constant 0 = 0x0)
1019 2 jsauermann
;--     store_rr_var check_sum = -5(FP), SP at -7
1020
        MOVE    R, 2(SP)
1021 7 jsauermann
;;;                               } 15 Expr l = r
1022
;;;                             } 14 ExpressionStatement
1023
;;;                             { 14 ExpressionStatement
1024
;;;                               { 15 Expr l = r
1025
;;;                                 { 16 TypeName
1026
;;;                                   { 17 TypeSpecifier (all)
1027
;;;                                     spec = unsigned char (22000)
1028
;;;                                   } 17 TypeSpecifier (all)
1029
;;;                                   { 17 List
1030
;;;                                     { 18 DeclItem
1031
;;;                                       what = DECL_NAME
1032
;;;                                       name = c
1033
;;;                                     } 18 DeclItem
1034
;;;                                   } 17 List
1035
;;;                                 } 16 TypeName
1036
;;;                                 { 16 Expr l(r)
1037
;;;                                   { 17 TypeName
1038
;;;                                     { 18 TypeSpecifier (all)
1039
;;;                                       spec = int (80000)
1040
;;;                                     } 18 TypeSpecifier (all)
1041
;;;                                     { 18 List
1042
;;;                                       { 19 DeclItem
1043
;;;                                         what = DECL_NAME
1044
;;;                                         name = get_byte
1045
;;;                                       } 19 DeclItem
1046
;;;                                     } 18 List
1047
;;;                                   } 17 TypeName
1048 2 jsauermann
;--     push 2 bytes
1049
;--     call
1050
        CALL    Cget_byte
1051
;--     pop 0 bytes
1052 7 jsauermann
;;;                                 } 16 Expr l(r)
1053 2 jsauermann
;--     store_rr_var c = -7(FP), SP at -7
1054
        MOVE    R, 0(SP)
1055 7 jsauermann
;;;                               } 15 Expr l = r
1056
;;;                             } 14 ExpressionStatement
1057
;;;                             { 14 ExpressionStatement
1058
;;;                               { 15 Expr l += r
1059
;;;                                 { 16 TypeName
1060
;;;                                   { 17 TypeSpecifier (all)
1061
;;;                                     spec = unsigned char (22000)
1062
;;;                                   } 17 TypeSpecifier (all)
1063
;;;                                   { 17 List
1064
;;;                                     { 18 DeclItem
1065
;;;                                       what = DECL_NAME
1066
;;;                                       name = check_sum
1067
;;;                                     } 18 DeclItem
1068
;;;                                   } 17 List
1069
;;;                                 } 16 TypeName
1070
;;;                                 { 16 Expr l + r
1071
;;;                                   { 17 Expression (variable name)
1072
;;;                                     expr_type = "identifier" (check_sum)
1073 2 jsauermann
;--     load_rr_var check_sum = -5(FP), SP at -7 (8 bit)
1074
        MOVE    2(SP), RU
1075 7 jsauermann
;;;                                   } 17 Expression (variable name)
1076 2 jsauermann
;--     move_rr_to_ll
1077
        MOVE    RR, LL
1078 7 jsauermann
;;;                                   { 17 Expression (variable name)
1079
;;;                                     expr_type = "identifier" (c)
1080 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1081
        MOVE    0(SP), RU
1082 7 jsauermann
;;;                                   } 17 Expression (variable name)
1083 2 jsauermann
;--     scale_rr *1
1084
;--     l + r
1085
        ADD     LL, RR
1086 7 jsauermann
;;;                                 } 16 Expr l + r
1087 2 jsauermann
;--     store_rr_var check_sum = -5(FP), SP at -7
1088
        MOVE    R, 2(SP)
1089 7 jsauermann
;;;                               } 15 Expr l += r
1090
;;;                             } 14 ExpressionStatement
1091
;;;                             { 14 ExpressionStatement
1092
;;;                               { 15 Expr l = r
1093
;;;                                 { 16 TypeName
1094
;;;                                   { 17 TypeSpecifier (all)
1095
;;;                                     spec = unsigned char (22000)
1096
;;;                                   } 17 TypeSpecifier (all)
1097
;;;                                   { 17 List
1098
;;;                                     { 18 DeclItem
1099
;;;                                       what = DECL_NAME
1100
;;;                                       name = record_length
1101
;;;                                     } 18 DeclItem
1102
;;;                                   } 17 List
1103
;;;                                 } 16 TypeName
1104
;;;                                 { 16 Expression (variable name)
1105
;;;                                   expr_type = "identifier" (c)
1106 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1107
        MOVE    0(SP), RU
1108 7 jsauermann
;;;                                 } 16 Expression (variable name)
1109 2 jsauermann
;--     store_rr_var record_length = -1(FP), SP at -7
1110
        MOVE    R, 6(SP)
1111 7 jsauermann
;;;                               } 15 Expr l = r
1112
;;;                             } 14 ExpressionStatement
1113
;;;                             { 14 ExpressionStatement
1114
;;;                               { 15 Expr l = r
1115
;;;                                 { 16 TypeName
1116
;;;                                   { 17 TypeSpecifier (all)
1117
;;;                                     spec = unsigned char (22000)
1118
;;;                                   } 17 TypeSpecifier (all)
1119
;;;                                   { 17 List
1120
;;;                                     { 18 DeclItem
1121
;;;                                       what = DECL_NAME
1122
;;;                                       name = c
1123
;;;                                     } 18 DeclItem
1124
;;;                                   } 17 List
1125
;;;                                 } 16 TypeName
1126
;;;                                 { 16 Expr l(r)
1127
;;;                                   { 17 TypeName
1128
;;;                                     { 18 TypeSpecifier (all)
1129
;;;                                       spec = int (80000)
1130
;;;                                     } 18 TypeSpecifier (all)
1131
;;;                                     { 18 List
1132
;;;                                       { 19 DeclItem
1133
;;;                                         what = DECL_NAME
1134
;;;                                         name = get_byte
1135
;;;                                       } 19 DeclItem
1136
;;;                                     } 18 List
1137
;;;                                   } 17 TypeName
1138 2 jsauermann
;--     push 2 bytes
1139
;--     call
1140
        CALL    Cget_byte
1141
;--     pop 0 bytes
1142 7 jsauermann
;;;                                 } 16 Expr l(r)
1143 2 jsauermann
;--     store_rr_var c = -7(FP), SP at -7
1144
        MOVE    R, 0(SP)
1145 7 jsauermann
;;;                               } 15 Expr l = r
1146
;;;                             } 14 ExpressionStatement
1147
;;;                             { 14 ExpressionStatement
1148
;;;                               { 15 Expr l += r
1149
;;;                                 { 16 TypeName
1150
;;;                                   { 17 TypeSpecifier (all)
1151
;;;                                     spec = unsigned char (22000)
1152
;;;                                   } 17 TypeSpecifier (all)
1153
;;;                                   { 17 List
1154
;;;                                     { 18 DeclItem
1155
;;;                                       what = DECL_NAME
1156
;;;                                       name = check_sum
1157
;;;                                     } 18 DeclItem
1158
;;;                                   } 17 List
1159
;;;                                 } 16 TypeName
1160
;;;                                 { 16 Expr l + r
1161
;;;                                   { 17 Expression (variable name)
1162
;;;                                     expr_type = "identifier" (check_sum)
1163 2 jsauermann
;--     load_rr_var check_sum = -5(FP), SP at -7 (8 bit)
1164
        MOVE    2(SP), RU
1165 7 jsauermann
;;;                                   } 17 Expression (variable name)
1166 2 jsauermann
;--     move_rr_to_ll
1167
        MOVE    RR, LL
1168 7 jsauermann
;;;                                   { 17 Expression (variable name)
1169
;;;                                     expr_type = "identifier" (c)
1170 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1171
        MOVE    0(SP), RU
1172 7 jsauermann
;;;                                   } 17 Expression (variable name)
1173 2 jsauermann
;--     scale_rr *1
1174
;--     l + r
1175
        ADD     LL, RR
1176 7 jsauermann
;;;                                 } 16 Expr l + r
1177 2 jsauermann
;--     store_rr_var check_sum = -5(FP), SP at -7
1178
        MOVE    R, 2(SP)
1179 7 jsauermann
;;;                               } 15 Expr l += r
1180
;;;                             } 14 ExpressionStatement
1181
;;;                             { 14 ExpressionStatement
1182
;;;                               { 15 Expr l = r
1183
;;;                                 { 16 TypeName
1184
;;;                                   { 17 TypeSpecifier (all)
1185
;;;                                     spec = unsigned int (82000)
1186
;;;                                   } 17 TypeSpecifier (all)
1187
;;;                                   { 17 List
1188
;;;                                     { 18 DeclItem
1189
;;;                                       what = DECL_NAME
1190
;;;                                       name = address
1191
;;;                                     } 18 DeclItem
1192
;;;                                   } 17 List
1193
;;;                                 } 16 TypeName
1194
;;;                                 { 16 Expr l << r
1195
;;;                                   { 17 TypeName (internal)
1196
;;;                                     { 18 TypeSpecifier (all)
1197
;;;                                       spec = int (80000)
1198
;;;                                     } 18 TypeSpecifier (all)
1199
;;;                                   } 17 TypeName (internal)
1200
;;;                                   { 17 Expression (variable name)
1201
;;;                                     expr_type = "identifier" (c)
1202 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1203
        MOVE    0(SP), RU
1204 7 jsauermann
;;;                                   } 17 Expression (variable name)
1205 2 jsauermann
;--     l << r
1206
        LSL     RR, #0x0008
1207 7 jsauermann
;;;                                 } 16 Expr l << r
1208 2 jsauermann
;--     store_rr_var address = -3(FP), SP at -7
1209
        MOVE    RR, 4(SP)
1210 7 jsauermann
;;;                               } 15 Expr l = r
1211
;;;                             } 14 ExpressionStatement
1212
;;;                             { 14 ExpressionStatement
1213
;;;                               { 15 Expr l = r
1214
;;;                                 { 16 TypeName
1215
;;;                                   { 17 TypeSpecifier (all)
1216
;;;                                     spec = unsigned char (22000)
1217
;;;                                   } 17 TypeSpecifier (all)
1218
;;;                                   { 17 List
1219
;;;                                     { 18 DeclItem
1220
;;;                                       what = DECL_NAME
1221
;;;                                       name = c
1222
;;;                                     } 18 DeclItem
1223
;;;                                   } 17 List
1224
;;;                                 } 16 TypeName
1225
;;;                                 { 16 Expr l(r)
1226
;;;                                   { 17 TypeName
1227
;;;                                     { 18 TypeSpecifier (all)
1228
;;;                                       spec = int (80000)
1229
;;;                                     } 18 TypeSpecifier (all)
1230
;;;                                     { 18 List
1231
;;;                                       { 19 DeclItem
1232
;;;                                         what = DECL_NAME
1233
;;;                                         name = get_byte
1234
;;;                                       } 19 DeclItem
1235
;;;                                     } 18 List
1236
;;;                                   } 17 TypeName
1237 2 jsauermann
;--     push 2 bytes
1238
;--     call
1239
        CALL    Cget_byte
1240
;--     pop 0 bytes
1241 7 jsauermann
;;;                                 } 16 Expr l(r)
1242 2 jsauermann
;--     store_rr_var c = -7(FP), SP at -7
1243
        MOVE    R, 0(SP)
1244 7 jsauermann
;;;                               } 15 Expr l = r
1245
;;;                             } 14 ExpressionStatement
1246
;;;                             { 14 ExpressionStatement
1247
;;;                               { 15 Expr l += r
1248
;;;                                 { 16 TypeName
1249
;;;                                   { 17 TypeSpecifier (all)
1250
;;;                                     spec = unsigned char (22000)
1251
;;;                                   } 17 TypeSpecifier (all)
1252
;;;                                   { 17 List
1253
;;;                                     { 18 DeclItem
1254
;;;                                       what = DECL_NAME
1255
;;;                                       name = check_sum
1256
;;;                                     } 18 DeclItem
1257
;;;                                   } 17 List
1258
;;;                                 } 16 TypeName
1259
;;;                                 { 16 Expr l + r
1260
;;;                                   { 17 Expression (variable name)
1261
;;;                                     expr_type = "identifier" (check_sum)
1262 2 jsauermann
;--     load_rr_var check_sum = -5(FP), SP at -7 (8 bit)
1263
        MOVE    2(SP), RU
1264 7 jsauermann
;;;                                   } 17 Expression (variable name)
1265 2 jsauermann
;--     move_rr_to_ll
1266
        MOVE    RR, LL
1267 7 jsauermann
;;;                                   { 17 Expression (variable name)
1268
;;;                                     expr_type = "identifier" (c)
1269 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1270
        MOVE    0(SP), RU
1271 7 jsauermann
;;;                                   } 17 Expression (variable name)
1272 2 jsauermann
;--     scale_rr *1
1273
;--     l + r
1274
        ADD     LL, RR
1275 7 jsauermann
;;;                                 } 16 Expr l + r
1276 2 jsauermann
;--     store_rr_var check_sum = -5(FP), SP at -7
1277
        MOVE    R, 2(SP)
1278 7 jsauermann
;;;                               } 15 Expr l += r
1279
;;;                             } 14 ExpressionStatement
1280
;;;                             { 14 ExpressionStatement
1281
;;;                               { 15 Expr l | r
1282
;;;                                 { 16 TypeName
1283
;;;                                   { 17 TypeSpecifier (all)
1284
;;;                                     spec = unsigned int (82000)
1285
;;;                                   } 17 TypeSpecifier (all)
1286
;;;                                   { 17 List
1287
;;;                                     { 18 DeclItem
1288
;;;                                       what = DECL_NAME
1289
;;;                                       name = address
1290
;;;                                     } 18 DeclItem
1291
;;;                                   } 17 List
1292
;;;                                 } 16 TypeName
1293
;;;                                 { 16 Expr l | r
1294
;;;                                   { 17 TypeName (internal)
1295
;;;                                     { 18 TypeSpecifier (all)
1296
;;;                                       spec = unsigned int (82000)
1297
;;;                                     } 18 TypeSpecifier (all)
1298
;;;                                   } 17 TypeName (internal)
1299
;;;                                   { 17 Expression (variable name)
1300
;;;                                     expr_type = "identifier" (address)
1301 2 jsauermann
;--     load_rr_var address = -3(FP), SP at -7 (16 bit)
1302
        MOVE    4(SP), RR
1303 7 jsauermann
;;;                                   } 17 Expression (variable name)
1304 2 jsauermann
;--     move_rr_to_ll
1305
        MOVE    RR, LL
1306 7 jsauermann
;;;                                   { 17 Expression (variable name)
1307
;;;                                     expr_type = "identifier" (c)
1308 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1309
        MOVE    0(SP), RU
1310 7 jsauermann
;;;                                   } 17 Expression (variable name)
1311 2 jsauermann
;--     l | r
1312
        OR      LL, RR
1313 7 jsauermann
;;;                                 } 16 Expr l | r
1314 2 jsauermann
;--     store_rr_var address = -3(FP), SP at -7
1315
        MOVE    RR, 4(SP)
1316 7 jsauermann
;;;                               } 15 Expr l | r
1317
;;;                             } 14 ExpressionStatement
1318
;;;                             { 14 ExpressionStatement
1319
;;;                               { 15 Expr l = r
1320
;;;                                 { 16 TypeName
1321
;;;                                   { 17 TypeSpecifier (all)
1322
;;;                                     spec = unsigned char (22000)
1323
;;;                                   } 17 TypeSpecifier (all)
1324
;;;                                   { 17 List
1325
;;;                                     { 18 DeclItem
1326
;;;                                       what = DECL_NAME
1327
;;;                                       name = c
1328
;;;                                     } 18 DeclItem
1329
;;;                                   } 17 List
1330
;;;                                 } 16 TypeName
1331
;;;                                 { 16 Expr l(r)
1332
;;;                                   { 17 TypeName
1333
;;;                                     { 18 TypeSpecifier (all)
1334
;;;                                       spec = int (80000)
1335
;;;                                     } 18 TypeSpecifier (all)
1336
;;;                                     { 18 List
1337
;;;                                       { 19 DeclItem
1338
;;;                                         what = DECL_NAME
1339
;;;                                         name = get_byte
1340
;;;                                       } 19 DeclItem
1341
;;;                                     } 18 List
1342
;;;                                   } 17 TypeName
1343 2 jsauermann
;--     push 2 bytes
1344
;--     call
1345
        CALL    Cget_byte
1346
;--     pop 0 bytes
1347 7 jsauermann
;;;                                 } 16 Expr l(r)
1348 2 jsauermann
;--     store_rr_var c = -7(FP), SP at -7
1349
        MOVE    R, 0(SP)
1350 7 jsauermann
;;;                               } 15 Expr l = r
1351
;;;                             } 14 ExpressionStatement
1352
;;;                             { 14 ExpressionStatement
1353
;;;                               { 15 Expr l += r
1354
;;;                                 { 16 TypeName
1355
;;;                                   { 17 TypeSpecifier (all)
1356
;;;                                     spec = unsigned char (22000)
1357
;;;                                   } 17 TypeSpecifier (all)
1358
;;;                                   { 17 List
1359
;;;                                     { 18 DeclItem
1360
;;;                                       what = DECL_NAME
1361
;;;                                       name = check_sum
1362
;;;                                     } 18 DeclItem
1363
;;;                                   } 17 List
1364
;;;                                 } 16 TypeName
1365
;;;                                 { 16 Expr l + r
1366
;;;                                   { 17 Expression (variable name)
1367
;;;                                     expr_type = "identifier" (check_sum)
1368 2 jsauermann
;--     load_rr_var check_sum = -5(FP), SP at -7 (8 bit)
1369
        MOVE    2(SP), RU
1370 7 jsauermann
;;;                                   } 17 Expression (variable name)
1371 2 jsauermann
;--     move_rr_to_ll
1372
        MOVE    RR, LL
1373 7 jsauermann
;;;                                   { 17 Expression (variable name)
1374
;;;                                     expr_type = "identifier" (c)
1375 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1376
        MOVE    0(SP), RU
1377 7 jsauermann
;;;                                   } 17 Expression (variable name)
1378 2 jsauermann
;--     scale_rr *1
1379
;--     l + r
1380
        ADD     LL, RR
1381 7 jsauermann
;;;                                 } 16 Expr l + r
1382 2 jsauermann
;--     store_rr_var check_sum = -5(FP), SP at -7
1383
        MOVE    R, 2(SP)
1384 7 jsauermann
;;;                               } 15 Expr l += r
1385
;;;                             } 14 ExpressionStatement
1386
;;;                             { 14 ExpressionStatement
1387
;;;                               { 15 Expr l = r
1388
;;;                                 { 16 TypeName
1389
;;;                                   { 17 TypeSpecifier (all)
1390
;;;                                     spec = unsigned char (22000)
1391
;;;                                   } 17 TypeSpecifier (all)
1392
;;;                                   { 17 List
1393
;;;                                     { 18 DeclItem
1394
;;;                                       what = DECL_NAME
1395
;;;                                       name = record_type
1396
;;;                                     } 18 DeclItem
1397
;;;                                   } 17 List
1398
;;;                                 } 16 TypeName
1399
;;;                                 { 16 Expression (variable name)
1400
;;;                                   expr_type = "identifier" (c)
1401 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1402
        MOVE    0(SP), RU
1403 7 jsauermann
;;;                                 } 16 Expression (variable name)
1404 2 jsauermann
;--     store_rr_var record_type = -4(FP), SP at -7
1405
        MOVE    R, 3(SP)
1406 7 jsauermann
;;;                               } 15 Expr l = r
1407
;;;                             } 14 ExpressionStatement
1408
;;;                             { 14 for Statement
1409
;;;                               { 15 ExpressionStatement
1410
;;;                                 { 16 Expr l = r
1411
;;;                                   { 17 TypeName
1412
;;;                                     { 18 TypeSpecifier (all)
1413
;;;                                       spec = unsigned char (22000)
1414
;;;                                     } 18 TypeSpecifier (all)
1415
;;;                                     { 18 List
1416
;;;                                       { 19 DeclItem
1417
;;;                                         what = DECL_NAME
1418
;;;                                         name = i
1419
;;;                                       } 19 DeclItem
1420
;;;                                     } 18 List
1421
;;;                                   } 17 TypeName
1422
;;;                                   { 17 NumericExpression (constant 0 = 0x0)
1423 2 jsauermann
;--     load_rr_constant
1424
        MOVE    #0x0000, RR
1425 7 jsauermann
;;;                                   } 17 NumericExpression (constant 0 = 0x0)
1426 2 jsauermann
;--     store_rr_var i = -6(FP), SP at -7
1427
        MOVE    R, 1(SP)
1428 7 jsauermann
;;;                                 } 16 Expr l = r
1429
;;;                               } 15 ExpressionStatement
1430 2 jsauermann
;--     branch
1431
        JMP     L7_tst_21
1432
L7_loop_21:
1433 7 jsauermann
;;;                               { 15 CompoundStatement
1434
;;;                                 { 16 List
1435
;;;                                   { 17 ExpressionStatement
1436
;;;                                     { 18 Expr l = r
1437
;;;                                       { 19 TypeName
1438
;;;                                         { 20 TypeSpecifier (all)
1439
;;;                                           spec = unsigned char (22000)
1440
;;;                                         } 20 TypeSpecifier (all)
1441
;;;                                         { 20 List
1442
;;;                                           { 21 DeclItem
1443
;;;                                             what = DECL_NAME
1444
;;;                                             name = c
1445
;;;                                           } 21 DeclItem
1446
;;;                                         } 20 List
1447
;;;                                       } 19 TypeName
1448
;;;                                       { 19 Expr l(r)
1449
;;;                                         { 20 TypeName
1450
;;;                                           { 21 TypeSpecifier (all)
1451
;;;                                             spec = int (80000)
1452
;;;                                           } 21 TypeSpecifier (all)
1453
;;;                                           { 21 List
1454
;;;                                             { 22 DeclItem
1455
;;;                                               what = DECL_NAME
1456
;;;                                               name = get_byte
1457
;;;                                             } 22 DeclItem
1458
;;;                                           } 21 List
1459
;;;                                         } 20 TypeName
1460 2 jsauermann
;--     push 2 bytes
1461
;--     call
1462
        CALL    Cget_byte
1463
;--     pop 0 bytes
1464 7 jsauermann
;;;                                       } 19 Expr l(r)
1465 2 jsauermann
;--     store_rr_var c = -7(FP), SP at -7
1466
        MOVE    R, 0(SP)
1467 7 jsauermann
;;;                                     } 18 Expr l = r
1468
;;;                                   } 17 ExpressionStatement
1469
;;;                                   { 17 ExpressionStatement
1470
;;;                                     { 18 Expr l = r
1471
;;;                                       { 19 TypeName
1472
;;;                                         { 20 TypeSpecifier (all)
1473
;;;                                           spec = char (20000)
1474
;;;                                         } 20 TypeSpecifier (all)
1475
;;;                                       } 19 TypeName
1476
;;;                                       { 19 Expression (variable name)
1477
;;;                                         expr_type = "identifier" (c)
1478 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1479
        MOVE    0(SP), RU
1480 7 jsauermann
;;;                                       } 19 Expression (variable name)
1481 2 jsauermann
;--     push_rr (8 bit)
1482
        MOVE    R, -(SP)
1483 7 jsauermann
;;;                                       { 19 Expr l[r]
1484
;;;                                         { 20 Expression (variable name)
1485
;;;                                           expr_type = "identifier" (i)
1486 2 jsauermann
;--     load_rr_var i = -6(FP), SP at -8 (8 bit)
1487
        MOVE    2(SP), RU
1488 7 jsauermann
;;;                                         } 20 Expression (variable name)
1489 2 jsauermann
;--     scale_rr *1
1490
;--     push_rr (16 bit)
1491
        MOVE    RR, -(SP)
1492 7 jsauermann
;;;                                         { 20 Expression (cast)r
1493
;;;                                           { 21 Expression (variable name)
1494
;;;                                             expr_type = "identifier" (address)
1495 2 jsauermann
;--     load_rr_var address = -3(FP), SP at -10 (16 bit)
1496
        MOVE    7(SP), RR
1497 7 jsauermann
;;;                                           } 21 Expression (variable name)
1498
;;;                                         } 20 Expression (cast)r
1499 2 jsauermann
;--     pop_ll (16 bit)
1500
        MOVE    (SP)+, LL
1501
;--     + (element)
1502
        ADD     LL, RR
1503 7 jsauermann
;;;                                       } 19 Expr l[r]
1504 2 jsauermann
;--     move_rr_to_ll
1505
        MOVE    RR, LL
1506
;--     pop_rr (8 bit)
1507
        MOVE    (SP)+, RS
1508
;--     assign (8 bit)
1509
        MOVE    R, (LL)
1510 7 jsauermann
;;;                                     } 18 Expr l = r
1511
;;;                                   } 17 ExpressionStatement
1512
;;;                                   { 17 ExpressionStatement
1513
;;;                                     { 18 Expr l += r
1514
;;;                                       { 19 TypeName
1515
;;;                                         { 20 TypeSpecifier (all)
1516
;;;                                           spec = unsigned char (22000)
1517
;;;                                         } 20 TypeSpecifier (all)
1518
;;;                                         { 20 List
1519
;;;                                           { 21 DeclItem
1520
;;;                                             what = DECL_NAME
1521
;;;                                             name = check_sum
1522
;;;                                           } 21 DeclItem
1523
;;;                                         } 20 List
1524
;;;                                       } 19 TypeName
1525
;;;                                       { 19 Expr l + r
1526
;;;                                         { 20 Expression (variable name)
1527
;;;                                           expr_type = "identifier" (check_sum)
1528 2 jsauermann
;--     load_rr_var check_sum = -5(FP), SP at -7 (8 bit)
1529
        MOVE    2(SP), RU
1530 7 jsauermann
;;;                                         } 20 Expression (variable name)
1531 2 jsauermann
;--     move_rr_to_ll
1532
        MOVE    RR, LL
1533 7 jsauermann
;;;                                         { 20 Expression (variable name)
1534
;;;                                           expr_type = "identifier" (c)
1535 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1536
        MOVE    0(SP), RU
1537 7 jsauermann
;;;                                         } 20 Expression (variable name)
1538 2 jsauermann
;--     scale_rr *1
1539
;--     l + r
1540
        ADD     LL, RR
1541 7 jsauermann
;;;                                       } 19 Expr l + r
1542 2 jsauermann
;--     store_rr_var check_sum = -5(FP), SP at -7
1543
        MOVE    R, 2(SP)
1544 7 jsauermann
;;;                                     } 18 Expr l += r
1545
;;;                                   } 17 ExpressionStatement
1546
;;;                                 } 16 List
1547
;--     pop 0 bytes
1548
;;;                               } 15 CompoundStatement
1549 2 jsauermann
L7_cont_21:
1550 7 jsauermann
;;;                               { 15 Expr l - r
1551
;;;                                 { 16 Expr ++r
1552
;;;                                   { 17 Expression (variable name)
1553
;;;                                     expr_type = "identifier" (i)
1554 2 jsauermann
;--     load_rr_var i = -6(FP), SP at -7 (8 bit)
1555
        MOVE    1(SP), RU
1556 7 jsauermann
;;;                                   } 17 Expression (variable name)
1557 2 jsauermann
;--     ++
1558
        ADD     RR, #0x0001
1559
;--     store_rr_var i = -6(FP), SP at -7
1560
        MOVE    R, 1(SP)
1561 7 jsauermann
;;;                                 } 16 Expr ++r
1562 2 jsauermann
;--     l - r
1563
        SUB     RR, #0x0001
1564 7 jsauermann
;;;                               } 15 Expr l - r
1565 2 jsauermann
L7_tst_21:
1566 7 jsauermann
;;;                               { 15 Expr l < r
1567
;;;                                 { 16 TypeName (internal)
1568
;;;                                   { 17 TypeSpecifier (all)
1569
;;;                                     spec = unsigned int (82000)
1570
;;;                                   } 17 TypeSpecifier (all)
1571
;;;                                 } 16 TypeName (internal)
1572
;;;                                 { 16 Expression (variable name)
1573
;;;                                   expr_type = "identifier" (i)
1574 2 jsauermann
;--     load_rr_var i = -6(FP), SP at -7 (8 bit)
1575
        MOVE    1(SP), RU
1576 7 jsauermann
;;;                                 } 16 Expression (variable name)
1577 2 jsauermann
;--     move_rr_to_ll
1578
        MOVE    RR, LL
1579 7 jsauermann
;;;                                 { 16 Expression (variable name)
1580
;;;                                   expr_type = "identifier" (record_length)
1581 2 jsauermann
;--     load_rr_var record_length = -1(FP), SP at -7 (8 bit)
1582
        MOVE    6(SP), RU
1583 7 jsauermann
;;;                                 } 16 Expression (variable name)
1584 2 jsauermann
;--     l < r
1585
        SLO     LL, RR
1586 7 jsauermann
;;;                               } 15 Expr l < r
1587 2 jsauermann
;--     branch_true
1588
        JMP     RRNZ, L7_loop_21
1589
L7_brk_22:
1590 7 jsauermann
;;;                             } 14 for Statement
1591
;;;                             { 14 ExpressionStatement
1592
;;;                               { 15 Expr l = r
1593
;;;                                 { 16 TypeName
1594
;;;                                   { 17 TypeSpecifier (all)
1595
;;;                                     spec = unsigned char (22000)
1596
;;;                                   } 17 TypeSpecifier (all)
1597
;;;                                   { 17 List
1598
;;;                                     { 18 DeclItem
1599
;;;                                       what = DECL_NAME
1600
;;;                                       name = c
1601
;;;                                     } 18 DeclItem
1602
;;;                                   } 17 List
1603
;;;                                 } 16 TypeName
1604
;;;                                 { 16 Expr l(r)
1605
;;;                                   { 17 TypeName
1606
;;;                                     { 18 TypeSpecifier (all)
1607
;;;                                       spec = int (80000)
1608
;;;                                     } 18 TypeSpecifier (all)
1609
;;;                                     { 18 List
1610
;;;                                       { 19 DeclItem
1611
;;;                                         what = DECL_NAME
1612
;;;                                         name = get_byte
1613
;;;                                       } 19 DeclItem
1614
;;;                                     } 18 List
1615
;;;                                   } 17 TypeName
1616 2 jsauermann
;--     push 2 bytes
1617
;--     call
1618
        CALL    Cget_byte
1619
;--     pop 0 bytes
1620 7 jsauermann
;;;                                 } 16 Expr l(r)
1621 2 jsauermann
;--     store_rr_var c = -7(FP), SP at -7
1622
        MOVE    R, 0(SP)
1623 7 jsauermann
;;;                               } 15 Expr l = r
1624
;;;                             } 14 ExpressionStatement
1625
;;;                             { 14 ExpressionStatement
1626
;;;                               { 15 Expr l += r
1627
;;;                                 { 16 TypeName
1628
;;;                                   { 17 TypeSpecifier (all)
1629
;;;                                     spec = unsigned char (22000)
1630
;;;                                   } 17 TypeSpecifier (all)
1631
;;;                                   { 17 List
1632
;;;                                     { 18 DeclItem
1633
;;;                                       what = DECL_NAME
1634
;;;                                       name = check_sum
1635
;;;                                     } 18 DeclItem
1636
;;;                                   } 17 List
1637
;;;                                 } 16 TypeName
1638
;;;                                 { 16 Expr l + r
1639
;;;                                   { 17 Expression (variable name)
1640
;;;                                     expr_type = "identifier" (check_sum)
1641 2 jsauermann
;--     load_rr_var check_sum = -5(FP), SP at -7 (8 bit)
1642
        MOVE    2(SP), RU
1643 7 jsauermann
;;;                                   } 17 Expression (variable name)
1644 2 jsauermann
;--     move_rr_to_ll
1645
        MOVE    RR, LL
1646 7 jsauermann
;;;                                   { 17 Expression (variable name)
1647
;;;                                     expr_type = "identifier" (c)
1648 2 jsauermann
;--     load_rr_var c = -7(FP), SP at -7 (8 bit)
1649
        MOVE    0(SP), RU
1650 7 jsauermann
;;;                                   } 17 Expression (variable name)
1651 2 jsauermann
;--     scale_rr *1
1652
;--     l + r
1653
        ADD     LL, RR
1654 7 jsauermann
;;;                                 } 16 Expr l + r
1655 2 jsauermann
;--     store_rr_var check_sum = -5(FP), SP at -7
1656
        MOVE    R, 2(SP)
1657 7 jsauermann
;;;                               } 15 Expr l += r
1658
;;;                             } 14 ExpressionStatement
1659
;;;                             { 14 IfElseStatement
1660
;;;                               { 15 Expression (variable name)
1661
;;;                                 expr_type = "identifier" (check_sum)
1662 2 jsauermann
;--     load_rr_var check_sum = -5(FP), SP at -7 (8 bit)
1663
        MOVE    2(SP), RU
1664 7 jsauermann
;;;                               } 15 Expression (variable name)
1665 2 jsauermann
;--     branch_false
1666
        JMP     RRZ, L7_endif_23
1667 7 jsauermann
;;;                               { 15 break/continue Statement
1668 2 jsauermann
;--     branch
1669
        JMP     L7_brk_18
1670 7 jsauermann
;;;                               } 15 break/continue Statement
1671 2 jsauermann
L7_endif_23:
1672 7 jsauermann
;;;                             } 14 IfElseStatement
1673
;;;                             { 14 ExpressionStatement
1674
;;;                               { 15 Expr l(r)
1675
;;;                                 { 16 TypeName
1676
;;;                                   { 17 TypeSpecifier (all)
1677
;;;                                     spec = void (10000)
1678
;;;                                   } 17 TypeSpecifier (all)
1679
;;;                                   { 17 List
1680
;;;                                     { 18 DeclItem
1681
;;;                                       what = DECL_NAME
1682
;;;                                       name = putchr
1683
;;;                                     } 18 DeclItem
1684
;;;                                   } 17 List
1685
;;;                                 } 16 TypeName
1686
;;;                                 { 16 ParameterDeclaration
1687
;;;                                   isEllipsis = false
1688
;;;                                   { 17 TypeName
1689
;;;                                     { 18 TypeSpecifier (all)
1690
;;;                                       spec = char (20000)
1691
;;;                                     } 18 TypeSpecifier (all)
1692
;;;                                     { 18 List
1693
;;;                                       { 19 DeclItem
1694
;;;                                         what = DECL_NAME
1695
;;;                                         name = c
1696
;;;                                       } 19 DeclItem
1697
;;;                                     } 18 List
1698
;;;                                   } 17 TypeName
1699
;;;                                 } 16 ParameterDeclaration
1700
;;;                                 { 16 NumericExpression (constant 46 = 0x2E)
1701 2 jsauermann
;--     load_rr_constant
1702
        MOVE    #0x002E, RR
1703 7 jsauermann
;;;                                 } 16 NumericExpression (constant 46 = 0x2E)
1704 2 jsauermann
;--     push_rr (8 bit)
1705
        MOVE    R, -(SP)
1706
;--     push 0 bytes
1707
;--     call
1708
        CALL    Cputchr
1709
;--     pop 1 bytes
1710
        ADD     SP, #1
1711 7 jsauermann
;;;                               } 15 Expr l(r)
1712
;;;                             } 14 ExpressionStatement
1713
;;;                             { 14 IfElseStatement
1714
;;;                               { 15 Expr l == r
1715
;;;                                 { 16 TypeName (internal)
1716
;;;                                   { 17 TypeSpecifier (all)
1717
;;;                                     spec = unsigned int (82000)
1718
;;;                                   } 17 TypeSpecifier (all)
1719
;;;                                 } 16 TypeName (internal)
1720
;;;                                 { 16 Expression (variable name)
1721
;;;                                   expr_type = "identifier" (record_type)
1722 2 jsauermann
;--     load_rr_var record_type = -4(FP), SP at -7 (8 bit)
1723
        MOVE    3(SP), RU
1724 7 jsauermann
;;;                                 } 16 Expression (variable name)
1725 2 jsauermann
;--     l == r
1726
        SEQ     RR, #0x0001
1727 7 jsauermann
;;;                               } 15 Expr l == r
1728 2 jsauermann
;--     branch_false
1729
        JMP     RRZ, L7_endif_24
1730 7 jsauermann
;;;                               { 15 CompoundStatement
1731
;;;                                 { 16 List
1732
;;;                                   { 17 ExpressionStatement
1733
;;;                                     { 18 Expr l(r)
1734
;;;                                       { 19 TypeName
1735
;;;                                         { 20 TypeSpecifier (all)
1736
;;;                                           spec = void (10000)
1737
;;;                                         } 20 TypeSpecifier (all)
1738
;;;                                         { 20 List
1739
;;;                                           { 21 DeclItem
1740
;;;                                             what = DECL_NAME
1741
;;;                                             name = print_string
1742
;;;                                           } 21 DeclItem
1743
;;;                                         } 20 List
1744
;;;                                       } 19 TypeName
1745
;;;                                       { 19 ParameterDeclaration
1746
;;;                                         isEllipsis = false
1747
;;;                                         { 20 TypeName
1748
;;;                                           { 21 TypeSpecifier (all)
1749
;;;                                             spec = const char (20100)
1750
;;;                                           } 21 TypeSpecifier (all)
1751
;;;                                           { 21 List
1752
;;;                                             { 22 DeclItem
1753
;;;                                               what = DECL_POINTER
1754
;;;                                               { 23 List
1755
;;;                                                 { 24 Ptr
1756
;;;                                                 } 24 Ptr
1757
;;;                                               } 23 List
1758
;;;                                             } 22 DeclItem
1759
;;;                                             { 22 DeclItem
1760
;;;                                               what = DECL_NAME
1761
;;;                                               name = buffer
1762
;;;                                             } 22 DeclItem
1763
;;;                                           } 21 List
1764
;;;                                         } 20 TypeName
1765
;;;                                       } 19 ParameterDeclaration
1766
;;;                                       { 19 StringExpression
1767 2 jsauermann
;--     load_rr_string
1768
        MOVE    #Cstr_8, RR
1769 7 jsauermann
;;;                                       } 19 StringExpression
1770 2 jsauermann
;--     push_rr (16 bit)
1771
        MOVE    RR, -(SP)
1772
;--     push 0 bytes
1773
;--     call
1774
        CALL    Cprint_string
1775
;--     pop 2 bytes
1776
        ADD     SP, #2
1777 7 jsauermann
;;;                                     } 18 Expr l(r)
1778
;;;                                   } 17 ExpressionStatement
1779
;;;                                   { 17 ExpressionStatement
1780
;;;                                     { 18 Expr l(r)
1781
;;;                                       { 19 TypeName
1782
;;;                                         { 20 TypeSpecifier (all)
1783
;;;                                           spec = void (10000)
1784
;;;                                         } 20 TypeSpecifier (all)
1785
;;;                                       } 19 TypeName
1786 2 jsauermann
;--     push 2 bytes
1787 7 jsauermann
;;;                                       { 19 Expression (cast)r
1788
;;;                                         { 20 Expression (variable name)
1789
;;;                                           expr_type = "identifier" (address)
1790 2 jsauermann
;--     load_rr_var address = -3(FP), SP at -7 (16 bit)
1791
        MOVE    4(SP), RR
1792 7 jsauermann
;;;                                         } 20 Expression (variable name)
1793
;;;                                       } 19 Expression (cast)r
1794 2 jsauermann
;--     call_ptr
1795
        CALL    (RR)
1796
;--     pop 0 bytes
1797 7 jsauermann
;;;                                     } 18 Expr l(r)
1798
;;;                                   } 17 ExpressionStatement
1799
;;;                                 } 16 List
1800
;--     pop 0 bytes
1801
;;;                               } 15 CompoundStatement
1802 2 jsauermann
L7_endif_24:
1803 7 jsauermann
;;;                             } 14 IfElseStatement
1804
;;;                           } 13 List
1805
;--     pop 0 bytes
1806
;;;                         } 12 CompoundStatement
1807 2 jsauermann
L7_cont_17:
1808
;--     branch
1809
        JMP     L7_loop_17
1810
L7_brk_18:
1811 7 jsauermann
;;;                       } 11 for Statement
1812
;;;                       { 11 ExpressionStatement
1813
;;;                         { 12 Expr l(r)
1814
;;;                           { 13 TypeName
1815
;;;                             { 14 TypeSpecifier (all)
1816
;;;                               spec = void (10000)
1817
;;;                             } 14 TypeSpecifier (all)
1818
;;;                             { 14 List
1819
;;;                               { 15 DeclItem
1820
;;;                                 what = DECL_NAME
1821
;;;                                 name = print_string
1822
;;;                               } 15 DeclItem
1823
;;;                             } 14 List
1824
;;;                           } 13 TypeName
1825
;;;                           { 13 ParameterDeclaration
1826
;;;                             isEllipsis = false
1827
;;;                             { 14 TypeName
1828
;;;                               { 15 TypeSpecifier (all)
1829
;;;                                 spec = const char (20100)
1830
;;;                               } 15 TypeSpecifier (all)
1831
;;;                               { 15 List
1832
;;;                                 { 16 DeclItem
1833
;;;                                   what = DECL_POINTER
1834
;;;                                   { 17 List
1835
;;;                                     { 18 Ptr
1836
;;;                                     } 18 Ptr
1837
;;;                                   } 17 List
1838
;;;                                 } 16 DeclItem
1839
;;;                                 { 16 DeclItem
1840
;;;                                   what = DECL_NAME
1841
;;;                                   name = buffer
1842
;;;                                 } 16 DeclItem
1843
;;;                               } 15 List
1844
;;;                             } 14 TypeName
1845
;;;                           } 13 ParameterDeclaration
1846
;;;                           { 13 StringExpression
1847 2 jsauermann
;--     load_rr_string
1848
        MOVE    #Cstr_9, RR
1849 7 jsauermann
;;;                           } 13 StringExpression
1850 2 jsauermann
;--     push_rr (16 bit)
1851
        MOVE    RR, -(SP)
1852
;--     push 0 bytes
1853
;--     call
1854
        CALL    Cprint_string
1855
;--     pop 2 bytes
1856
        ADD     SP, #2
1857 7 jsauermann
;;;                         } 12 Expr l(r)
1858
;;;                       } 11 ExpressionStatement
1859
;;;                     } 10 List
1860
;--     pop 0 bytes
1861
;;;                   } 9 CompoundStatement
1862 2 jsauermann
L7_cont_15:
1863
;--     branch
1864
        JMP     L7_loop_15
1865
L7_brk_16:
1866 7 jsauermann
;;;                 } 8 for Statement
1867
;;;               } 7 List
1868 2 jsauermann
;--     pop 7 bytes
1869
        ADD     SP, #7
1870 7 jsauermann
;;;             } 6 CompoundStatement
1871
;--     ret
1872 2 jsauermann
        RET
1873
;;; ------------------------------------;
1874
Cstr_5:                         ;
1875
        .BYTE   0x0D                    ;
1876
        .BYTE   0x0A                    ;
1877
        .BYTE   0x45                    ;
1878
        .BYTE   0x52                    ;
1879
        .BYTE   0x52                    ;
1880
        .BYTE   0x4F                    ;
1881
        .BYTE   0x52                    ;
1882
        .BYTE   0x3A                    ;
1883
        .BYTE   0x20                    ;
1884
        .BYTE   0x6E                    ;
1885
        .BYTE   0x6F                    ;
1886
        .BYTE   0x74                    ;
1887
        .BYTE   0x20                    ;
1888
        .BYTE   0x68                    ;
1889
        .BYTE   0x65                    ;
1890
        .BYTE   0x78                    ;
1891
        .BYTE   0x0D                    ;
1892
        .BYTE   0x0A                    ;
1893
        .BYTE   0                        ;
1894
Cstr_7:                         ;
1895
        .BYTE   0x0D                    ;
1896
        .BYTE   0x0A                    ;
1897
        .BYTE   0x4C                    ;
1898
        .BYTE   0x4F                    ;
1899
        .BYTE   0x41                    ;
1900
        .BYTE   0x44                    ;
1901
        .BYTE   0x20                    ;
1902
        .BYTE   0x3E                    ;
1903
        .BYTE   0x20                    ;
1904
        .BYTE   0                        ;
1905
Cstr_8:                         ;
1906
        .BYTE   0x0D                    ;
1907
        .BYTE   0x0A                    ;
1908
        .BYTE   0x44                    ;
1909
        .BYTE   0x4F                    ;
1910
        .BYTE   0x4E                    ;
1911
        .BYTE   0x45                    ;
1912
        .BYTE   0x2E                    ;
1913
        .BYTE   0x0D                    ;
1914
        .BYTE   0x0A                    ;
1915
        .BYTE   0                        ;
1916
Cstr_9:                         ;
1917
        .BYTE   0x0D                    ;
1918
        .BYTE   0x0A                    ;
1919
        .BYTE   0x43                    ;
1920
        .BYTE   0x48                    ;
1921
        .BYTE   0x45                    ;
1922
        .BYTE   0x43                    ;
1923
        .BYTE   0x4B                    ;
1924
        .BYTE   0x53                    ;
1925
        .BYTE   0x55                    ;
1926
        .BYTE   0x4D                    ;
1927
        .BYTE   0x20                    ;
1928
        .BYTE   0x45                    ;
1929
        .BYTE   0x52                    ;
1930
        .BYTE   0x52                    ;
1931
        .BYTE   0x4F                    ;
1932
        .BYTE   0x52                    ;
1933
        .BYTE   0x2E                    ;
1934
        .BYTE   0                        ;
1935
Cend_text:                              ;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.