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

Subversion Repositories yacc

[/] [yacc/] [trunk/] [syn/] [c_src/] [calculator/] [uart_echo_test.s] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tak.sugawa
        .file   1 "uart_echo_test.c"
2
 
3
 # -G value = 8, Cpu = 3000, ISA = 1
4
 # GNU C version egcs-2.90.23 980102 (egcs-1.0.1 release) (sde) [AL 1.1, MM 40] Algorithmics SDE-MIPS v4.0.5 compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
5
 # options passed:  -O2 -O -Wall
6
 # options enabled:  -fdefer-pop -fomit-frame-pointer -fthread-jumps
7
 # -fpeephole -finline -fkeep-static-consts -fpcc-struct-return
8
 # -fdelayed-branch -fcommon -fverbose-asm -fgnu-linker -falias-check
9
 # -fargument-alias -msplit-addresses -mgas -mrnames -mgpOPT -mgpopt
10
 # -membedded-data -meb -mmad -marg32 -mdebugh -mdebugi -mmadd -mno-gpconst
11
 # -mcpu=3000
12
 
13
gcc2_compiled.:
14
        .globl  int_flag
15
        .sdata
16
        .align  0
17
        .align  2
18
int_flag:
19
        .size   int_flag,4
20
        .word   0
21
        .rdata
22
        .align  0
23
        .align  2
24
.LC0:
25
        .ascii  "PError!\n\000"
26
        .align  2
27
.LC1:
28
        .ascii  "Sorry Overflow..!\n\000"
29
        .rdata
30
        .align  0
31
        .align  2
32
.LC2:
33
        .ascii  "\n"
34
        .ascii  " parse error occurred\n\000"
35
        .rdata
36
        .align  0
37
        .align  2
38
.LC3:
39
        .ascii  "Welcome to YACC World.Apr.8.2005 www.sugawara-systems.co"
40
        .ascii  "m\000"
41
        .align  2
42
.LC4:
43
        .ascii  "YACC>\000"
44
 
45
        .comm   read_ptr,4
46
 
47
        .comm   buffer,160
48
 
49
        .comm   result_buffer,8
50
 
51
        .comm   sym,1
52
 
53
        .comm   char_ptr,4
54
 
55
        .comm   buf,2
56
 
57
        .text
58
        .text
59
        .align  2
60
        .globl  print_uart
61
        .ent    print_uart
62
print_uart:
63
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
64
        .mask   0x00000000,0
65
        .fmask  0x00000000,0
66
        lbu     $v0,0($a0)
67
        beq     $v0,$zero,.L3
68
        li      $v1,16380                       # 0x00003ffc
69
.L5:
70
        #.set   volatile
71
        lw      $v0,0($v1)
72
        #.set   novolatile
73
        andi    $v0,$v0,0x0100
74
        bne     $v0,$zero,.L5
75
        lbu     $v0,0($a0)
76
        #.set   volatile
77
        sb      $v0,0($v1)
78
        #.set   novolatile
79
        addu    $a0,$a0,1
80
        lbu     $v0,0($a0)
81
        bne     $v0,$zero,.L5
82
.L3:
83
        j       $ra
84
        .end    print_uart
85
        .size   print_uart,.-print_uart
86
        .align  2
87
        .globl  putc_uart
88
        .ent    putc_uart
89
putc_uart:
90
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
91
        .mask   0x00000000,0
92
        .fmask  0x00000000,0
93
        andi    $a0,$a0,0x00ff
94
        li      $v1,16380                       # 0x00003ffc
95
.L11:
96
        #.set   volatile
97
        lw      $v0,0($v1)
98
        #.set   novolatile
99
        andi    $v0,$v0,0x0100
100
        .set    noreorder
101
        .set    nomacro
102
        bne     $v0,$zero,.L11
103
        li      $v0,16380                       # 0x00003ffc
104
        .set    macro
105
        .set    reorder
106
 
107
        #.set   volatile
108
        sb      $a0,0($v0)
109
        #.set   novolatile
110
        j       $ra
111
        .end    putc_uart
112
        .size   putc_uart,.-putc_uart
113
        .align  2
114
        .globl  print_char
115
        .ent    print_char
116
print_char:
117
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
118
        .mask   0x00000000,0
119
        .fmask  0x00000000,0
120
        andi    $a0,$a0,0x00ff
121
        li      $v0,16369                       # 0x00003ff1
122
        #.set   volatile
123
        sb      $a0,0($v0)
124
        #.set   novolatile
125
        j       $ra
126
        .end    print_char
127
        .size   print_char,.-print_char
128
        .align  2
129
        .globl  read_uart
130
        .ent    read_uart
131
read_uart:
132
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
133
        .mask   0x00000000,0
134
        .fmask  0x00000000,0
135
        li      $v0,16380                       # 0x00003ffc
136
        #.set   volatile
137
        lw      $v0,0($v0)
138
        #.set   novolatile
139
        .set    noreorder
140
        .set    nomacro
141
        j       $ra
142
        andi    $v0,$v0,0x00ff
143
        .set    macro
144
        .set    reorder
145
 
146
        .end    read_uart
147
        .size   read_uart,.-read_uart
148
        .align  2
149
        .globl  print
150
        .ent    print
151
print:
152
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
153
        .mask   0x00000000,0
154
        .fmask  0x00000000,0
155
        lbu     $v0,0($a0)
156
        .set    noreorder
157
        .set    nomacro
158
        beq     $v0,$zero,.L19
159
        move    $v1,$v0
160
        .set    macro
161
        .set    reorder
162
 
163
        li      $a1,16368                       # 0x00003ff0
164
        move    $v0,$v1
165
.L22:
166
        #.set   volatile
167
        sb      $v0,0($a1)
168
        #.set   novolatile
169
        addu    $a0,$a0,1
170
        lbu     $v1,0($a0)
171
        .set    noreorder
172
        .set    nomacro
173
        bne     $v1,$zero,.L22
174
        move    $v0,$v1
175
        .set    macro
176
        .set    reorder
177
 
178
.L19:
179
        li      $v0,16368                       # 0x00003ff0
180
        #.set   volatile
181
        sb      $zero,0($v0)
182
        #.set   novolatile
183
        j       $ra
184
        .end    print
185
        .size   print,.-print
186
        .align  2
187
        .globl  print_short
188
        .ent    print_short
189
print_short:
190
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
191
        .mask   0x00000000,0
192
        .fmask  0x00000000,0
193
        sll     $a0,$a0,16
194
        sra     $a0,$a0,16
195
        li      $v0,16370                       # 0x00003ff2
196
        #.set   volatile
197
        sh      $a0,0($v0)
198
        #.set   novolatile
199
        j       $ra
200
        .end    print_short
201
        .size   print_short,.-print_short
202
        .align  2
203
        .globl  print_long
204
        .ent    print_long
205
print_long:
206
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
207
        .mask   0x00000000,0
208
        .fmask  0x00000000,0
209
        li      $v0,16372                       # 0x00003ff4
210
        #.set   volatile
211
        sw      $a0,0($v0)
212
        #.set   novolatile
213
        j       $ra
214
        .end    print_long
215
        .size   print_long,.-print_long
216
        .text
217
        .align  2
218
        .globl  interrupt
219
        .ent    interrupt
220
interrupt:
221
        .frame  $sp,24,$ra              # vars= 0, regs= 2/0, args= 16, extra= 0
222
        .mask   0x80010000,-4
223
        .fmask  0x00000000,0
224
        subu    $sp,$sp,24
225
        sw      $ra,20($sp)
226
        sw      $s0,16($sp)
227
 #APP
228
        addiu   $sp,$sp,-52 ;
229
                sw      $a0,($sp)
230
                sw  $v0,4($sp)
231
                sw  $v1,8($sp)
232
                sw  $a1,12($sp)
233
                sw  $s0,16($sp)
234
                sw  $s1,20($sp)
235
                sw  $s2,24($sp)
236
                sw  $a3,28($sp)
237
                sw  $s4,32($sp)
238
                sw  $s5,36($sp)
239
                sw  $s6,40($sp)
240
                sw  $s7,44($sp)
241
                sw  $a2,48($sp)
242
 #NO_APP
243
        jal     read_uart
244
        move    $s0,$v0
245
        xori    $v1,$s0,0x000a
246
        sltu    $v1,$v1,1
247
        xori    $v0,$s0,0x000d
248
        sltu    $v0,$v0,1
249
        or      $v1,$v1,$v0
250
        .set    noreorder
251
        .set    nomacro
252
        beq     $v1,$zero,.L26
253
        li      $v0,8                   # 0x00000008
254
        .set    macro
255
        .set    reorder
256
 
257
        lw      $v0,read_ptr
258
        sb      $zero,0($v0)
259
        lui     $v0,%hi(buffer) # high
260
        addiu   $v0,$v0,%lo(buffer) # low
261
        sw      $v0,read_ptr
262
        .set    noreorder
263
        .set    nomacro
264
        jal     putc_uart
265
        li      $a0,10                  # 0x0000000a
266
        .set    macro
267
        .set    reorder
268
 
269
        .set    noreorder
270
        .set    nomacro
271
        jal     putc_uart
272
        li      $a0,13                  # 0x0000000d
273
        .set    macro
274
        .set    reorder
275
 
276
        #.set   volatile
277
        lw      $v0,int_flag
278
        #.set   novolatile
279
        .set    noreorder
280
        .set    nomacro
281
        beq     $v0,$zero,.L27
282
        lui     $a0,%hi(.LC0) # high
283
        .set    macro
284
        .set    reorder
285
 
286
        .set    noreorder
287
        .set    nomacro
288
        jal     print
289
        addiu   $a0,$a0,%lo(.LC0) # low
290
        .set    macro
291
        .set    reorder
292
 
293
        b       .L29
294
.L27:
295
        li      $v0,1                   # 0x00000001
296
        #.set   volatile
297
        sw      $v0,int_flag
298
        #.set   novolatile
299
        b       .L29
300
.L26:
301
        .set    noreorder
302
        .set    nomacro
303
        bne     $s0,$v0,.L30
304
        lui     $v0,%hi(buffer) # high
305
        .set    macro
306
        .set    reorder
307
 
308
        lw      $v1,read_ptr
309
        addiu   $v0,$v0,%lo(buffer) # low
310
        sltu    $v0,$v0,$v1
311
        beq     $v0,$zero,.L35
312
        .set    noreorder
313
        .set    nomacro
314
        jal     putc_uart
315
        li      $a0,8                   # 0x00000008
316
        .set    macro
317
        .set    reorder
318
 
319
        lw      $v0,read_ptr
320
        .set    noreorder
321
        .set    nomacro
322
        b       .L34
323
        addu    $v0,$v0,-1
324
        .set    macro
325
        .set    reorder
326
 
327
.L30:
328
        lw      $v1,read_ptr
329
.L35:
330
        lui     $v0,%hi(buffer+160) # high
331
        addiu   $a0,$v0,%lo(buffer+160) # low
332
        sltu    $v0,$v1,$a0
333
        .set    noreorder
334
        .set    nomacro
335
        bne     $v0,$zero,.L32
336
        addu    $v0,$a0,-160
337
        .set    macro
338
        .set    reorder
339
 
340
        sb      $zero,0($v1)
341
        sw      $v0,read_ptr
342
        lui     $a0,%hi(.LC1) # high
343
        .set    noreorder
344
        .set    nomacro
345
        jal     print_uart
346
        addiu   $a0,$a0,%lo(.LC1) # low
347
        .set    macro
348
        .set    reorder
349
 
350
        b       .L29
351
.L32:
352
        .set    noreorder
353
        .set    nomacro
354
        jal     putc_uart
355
        move    $a0,$s0
356
        .set    macro
357
        .set    reorder
358
 
359
        lw      $v0,read_ptr
360
        sb      $s0,0($v0)
361
        addu    $v0,$v0,1
362
.L34:
363
        sw      $v0,read_ptr
364
.L29:
365
 #APP
366
                lw      $a0,($sp)
367
                lw  $v0,4($sp)
368
                lw  $v1,8($sp)
369
                lw  $a1,12($sp)
370
                lw  $s0,16($sp)
371
                lw  $s1,20($sp)
372
                lw  $s2,24($sp)
373
                lw  $a3,28($sp)
374
                lw  $s4,32($sp)
375
                lw  $s5,36($sp)
376
                lw  $s6,40($sp)
377
                lw  $s7,44($sp)
378
                lw  $a2,48($sp)
379
        addiu   $sp,$sp,52 ;
380
        lw      $ra,20($sp);
381
        addiu   $sp,$sp,24 ;
382
        jr      $26
383
        nop
384
 #NO_APP
385
        lw      $ra,20($sp)
386
        lw      $s0,16($sp)
387
        .set    noreorder
388
        .set    nomacro
389
        j       $ra
390
        addu    $sp,$sp,24
391
        .set    macro
392
        .set    reorder
393
 
394
        .end    interrupt
395
        .size   interrupt,.-interrupt
396
        .align  2
397
        .globl  print_longlong
398
        .ent    print_longlong
399
print_longlong:
400
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
401
        .mask   0x00000000,0
402
        .fmask  0x00000000,0
403
        li      $a2,16372                       # 0x00003ff4
404
        sra     $v1,$a0,0
405
        sra     $v0,$a0,31
406
        #.set   volatile
407
        sw      $v1,0($a2)
408
        #.set   novolatile
409
        #.set   volatile
410
        sw      $a1,0($a2)
411
        #.set   novolatile
412
        j       $ra
413
        .end    print_longlong
414
        .size   print_longlong,.-print_longlong
415
        .align  2
416
        .globl  getsym
417
        .ent    getsym
418
getsym:
419
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
420
        .mask   0x00000000,0
421
        .fmask  0x00000000,0
422
        lw      $v0,char_ptr
423
        lbu     $a0,0($v0)
424
        .set    noreorder
425
        .set    nomacro
426
        b       .L47
427
        xori    $v1,$a0,0x0020
428
        .set    macro
429
        .set    reorder
430
 
431
.L42:
432
        lw      $v1,char_ptr
433
        addu    $v0,$v1,1
434
        sw      $v0,char_ptr
435
        lbu     $a0,1($v1)
436
        xori    $v1,$a0,0x0020
437
.L47:
438
        sltu    $v1,$v1,1
439
        xori    $v0,$a0,0x000a
440
        sltu    $v0,$v0,1
441
        or      $v1,$v1,$v0
442
        .set    noreorder
443
        .set    nomacro
444
        bne     $v1,$zero,.L42
445
        li      $v0,13                  # 0x0000000d
446
        .set    macro
447
        .set    reorder
448
 
449
        beq     $a0,$v0,.L42
450
        lw      $v0,char_ptr
451
        lbu     $v0,0($v0)
452
        bne     $v0,$zero,.L44
453
        sb      $zero,sym
454
        b       .L45
455
.L44:
456
        lw      $v0,char_ptr
457
        lbu     $v1,0($v0)
458
        sb      $v1,sym
459
        addu    $v0,$v0,1
460
        sw      $v0,char_ptr
461
.L45:
462
        j       $ra
463
        .end    getsym
464
        .size   getsym,.-getsym
465
        .align  2
466
        .globl  evaluate_number
467
        .ent    evaluate_number
468
evaluate_number:
469
        .frame  $sp,24,$ra              # vars= 0, regs= 2/0, args= 16, extra= 0
470
        .mask   0x80010000,-4
471
        .fmask  0x00000000,0
472
        subu    $sp,$sp,24
473
        sw      $ra,20($sp)
474
        sw      $s0,16($sp)
475
        lbu     $s0,sym
476
        lw      $v0,char_ptr
477
        move    $v1,$v0
478
        lbu     $v0,0($v0)
479
        .set    noreorder
480
        .set    nomacro
481
        b       .L55
482
        addu    $s0,$s0,-48
483
        .set    macro
484
        .set    reorder
485
 
486
.L53:
487
        addu    $v0,$v0,$s0
488
        sll     $v0,$v0,1
489
        move    $a0,$v1
490
        lbu     $v1,0($a0)
491
        addu    $v0,$v0,$v1
492
        addu    $s0,$v0,-48
493
        addu    $v0,$a0,1
494
        sw      $v0,char_ptr
495
        move    $v1,$v0
496
        lbu     $v0,1($a0)
497
.L55:
498
        addu    $v0,$v0,-48
499
        sltu    $v0,$v0,10
500
        .set    noreorder
501
        .set    nomacro
502
        bne     $v0,$zero,.L53
503
        sll     $v0,$s0,2
504
        .set    macro
505
        .set    reorder
506
 
507
        jal     getsym
508
        move    $v0,$s0
509
        lw      $ra,20($sp)
510
        lw      $s0,16($sp)
511
        .set    noreorder
512
        .set    nomacro
513
        j       $ra
514
        addu    $sp,$sp,24
515
        .set    macro
516
        .set    reorder
517
 
518
        .end    evaluate_number
519
        .size   evaluate_number,.-evaluate_number
520
        .align  2
521
        .globl  expression
522
        .ent    expression
523
expression:
524
        .frame  $sp,32,$ra              # vars= 0, regs= 4/0, args= 16, extra= 0
525
        .mask   0x80070000,-4
526
        .fmask  0x00000000,0
527
        subu    $sp,$sp,32
528
        sw      $ra,28($sp)
529
        sw      $s2,24($sp)
530
        sw      $s1,20($sp)
531
        sw      $s0,16($sp)
532
        lbu     $s0,sym
533
        xori    $v1,$s0,0x002b
534
        sltu    $v1,$v1,1
535
        xori    $v0,$s0,0x002d
536
        sltu    $v0,$v0,1
537
        or      $v1,$v1,$v0
538
        beq     $v1,$zero,.L57
539
        jal     getsym
540
.L57:
541
        jal     term
542
        move    $s1,$v0
543
        li      $v0,45                  # 0x0000002d
544
        bne     $s0,$v0,.L58
545
        subu    $s1,$zero,$s1
546
.L58:
547
        lbu     $v0,sym
548
        move    $a0,$v0
549
        andi    $v0,$v0,0x00ff
550
        xori    $v1,$v0,0x002b
551
        sltu    $v1,$v1,1
552
        xori    $v0,$v0,0x002d
553
        sltu    $v0,$v0,1
554
        or      $v1,$v1,$v0
555
        .set    noreorder
556
        .set    nomacro
557
        beq     $v1,$zero,.L60
558
        li      $s2,43                  # 0x0000002b
559
        .set    macro
560
        .set    reorder
561
 
562
.L61:
563
        .set    noreorder
564
        .set    nomacro
565
        jal     getsym
566
        move    $s0,$a0
567
        .set    macro
568
        .set    reorder
569
 
570
        jal     term
571
        bne     $s0,$s2,.L62
572
        .set    noreorder
573
        .set    nomacro
574
        b       .L59
575
        addu    $s1,$s1,$v0
576
        .set    macro
577
        .set    reorder
578
 
579
.L62:
580
        subu    $s1,$s1,$v0
581
.L59:
582
        lbu     $a0,sym
583
        andi    $v0,$a0,0x00ff
584
        xori    $v1,$v0,0x002b
585
        sltu    $v1,$v1,1
586
        xori    $v0,$v0,0x002d
587
        sltu    $v0,$v0,1
588
        or      $v1,$v1,$v0
589
        bne     $v1,$zero,.L61
590
.L60:
591
        move    $v0,$s1
592
        lw      $ra,28($sp)
593
        lw      $s2,24($sp)
594
        lw      $s1,20($sp)
595
        lw      $s0,16($sp)
596
        .set    noreorder
597
        .set    nomacro
598
        j       $ra
599
        addu    $sp,$sp,32
600
        .set    macro
601
        .set    reorder
602
 
603
        .end    expression
604
        .size   expression,.-expression
605
        .align  2
606
        .globl  term
607
        .ent    term
608
term:
609
        .frame  $sp,32,$ra              # vars= 0, regs= 3/0, args= 16, extra= 0
610
        .mask   0x80030000,-8
611
        .fmask  0x00000000,0
612
        subu    $sp,$sp,32
613
        sw      $ra,24($sp)
614
        sw      $s1,20($sp)
615
        .set    noreorder
616
        .set    nomacro
617
        jal     factor
618
        sw      $s0,16($sp)
619
        .set    macro
620
        .set    reorder
621
 
622
        .set    noreorder
623
        .set    nomacro
624
        b       .L66
625
        move    $s1,$v0
626
        .set    macro
627
        .set    reorder
628
 
629
.L68:
630
        lbu     $s0,sym
631
        jal     getsym
632
        jal     factor
633
        move    $v1,$v0
634
        li      $v0,42                  # 0x0000002a
635
        .set    noreorder
636
        .set    nomacro
637
        beq     $s0,$v0,.L70
638
        slt     $v0,$s0,43
639
        .set    macro
640
        .set    reorder
641
 
642
        .set    noreorder
643
        .set    nomacro
644
        beq     $v0,$zero,.L75
645
        li      $v0,37                  # 0x00000025
646
        .set    macro
647
        .set    reorder
648
 
649
        beq     $s0,$v0,.L72
650
        b       .L66
651
.L75:
652
        li      $v0,47                  # 0x0000002f
653
        beq     $s0,$v0,.L71
654
        b       .L66
655
.L70:
656
        mult    $s1,$v1
657
        mflo    $s1
658
        b       .L66
659
.L71:
660
        div     $s1,$s1,$v1
661
        b       .L66
662
.L72:
663
        rem     $s1,$s1,$v1
664
.L66:
665
        lbu     $a0,sym
666
        xori    $v1,$a0,0x002a
667
        sltu    $v1,$v1,1
668
        xori    $v0,$a0,0x002f
669
        sltu    $v0,$v0,1
670
        or      $v1,$v1,$v0
671
        .set    noreorder
672
        .set    nomacro
673
        bne     $v1,$zero,.L68
674
        li      $v0,37                  # 0x00000025
675
        .set    macro
676
        .set    reorder
677
 
678
        .set    noreorder
679
        .set    nomacro
680
        beq     $a0,$v0,.L68
681
        move    $v0,$s1
682
        .set    macro
683
        .set    reorder
684
 
685
        lw      $ra,24($sp)
686
        lw      $s1,20($sp)
687
        lw      $s0,16($sp)
688
        .set    noreorder
689
        .set    nomacro
690
        j       $ra
691
        addu    $sp,$sp,32
692
        .set    macro
693
        .set    reorder
694
 
695
        .end    term
696
        .size   term,.-term
697
        .text
698
        .align  2
699
        .globl  factor
700
        .ent    factor
701
factor:
702
        .frame  $sp,24,$ra              # vars= 0, regs= 2/0, args= 16, extra= 0
703
        .mask   0x80010000,-4
704
        .fmask  0x00000000,0
705
        subu    $sp,$sp,24
706
        sw      $ra,20($sp)
707
        sw      $s0,16($sp)
708
        lbu     $v0,sym
709
        addu    $v0,$v0,-48
710
        sltu    $v0,$v0,10
711
        .set    noreorder
712
        .set    nomacro
713
        beq     $v0,$zero,.L80
714
        li      $v0,40                  # 0x00000028
715
        .set    macro
716
        .set    reorder
717
 
718
        jal     evaluate_number
719
        b       .L89
720
.L80:
721
        lbu     $v1,sym
722
        bne     $v1,$v0,.L82
723
        jal     getsym
724
        jal     expression
725
        move    $s0,$v0
726
        lbu     $v1,sym
727
        li      $v0,41                  # 0x00000029
728
        .set    noreorder
729
        .set    nomacro
730
        beq     $v1,$v0,.L83
731
        lui     $a0,%hi(.LC2) # high
732
        .set    macro
733
        .set    reorder
734
 
735
        .set    noreorder
736
        .set    nomacro
737
        jal     print_uart
738
        addiu   $a0,$a0,%lo(.LC2) # low
739
        .set    macro
740
        .set    reorder
741
 
742
.L83:
743
        jal     getsym
744
        .set    noreorder
745
        .set    nomacro
746
        b       .L89
747
        move    $v0,$s0
748
        .set    macro
749
        .set    reorder
750
 
751
.L82:
752
        lbu     $v0,sym
753
        .set    noreorder
754
        .set    nomacro
755
        beq     $v0,$zero,.L89
756
        move    $v0,$zero
757
        .set    macro
758
        .set    reorder
759
 
760
        lui     $a0,%hi(.LC2) # high
761
        .set    noreorder
762
        .set    nomacro
763
        jal     print_uart
764
        addiu   $a0,$a0,%lo(.LC2) # low
765
        .set    macro
766
        .set    reorder
767
 
768
        move    $v0,$zero
769
.L89:
770
        lw      $ra,20($sp)
771
        lw      $s0,16($sp)
772
        .set    noreorder
773
        .set    nomacro
774
        j       $ra
775
        addu    $sp,$sp,24
776
        .set    macro
777
        .set    reorder
778
 
779
        .end    factor
780
        .size   factor,.-factor
781
        .align  2
782
        .globl  strrev
783
        .ent    strrev
784
strrev:
785
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
786
        .mask   0x00000000,0
787
        .fmask  0x00000000,0
788
        move    $a2,$a0
789
        lbu     $v0,0($a0)
790
        .set    noreorder
791
        .set    nomacro
792
        beq     $v0,$zero,.L99
793
        move    $a1,$a0
794
        .set    macro
795
        .set    reorder
796
 
797
        addu    $a1,$a1,1
798
.L101:
799
        lbu     $v0,0($a1)
800
        .set    noreorder
801
        .set    nomacro
802
        bne     $v0,$zero,.L101
803
        addu    $a1,$a1,1
804
        .set    macro
805
        .set    reorder
806
 
807
        addu    $a1,$a1,-1
808
        .set    noreorder
809
        .set    nomacro
810
        b       .L100
811
        addu    $a1,$a1,-1
812
        .set    macro
813
        .set    reorder
814
 
815
.L97:
816
        lbu     $v0,0($a2)
817
        lbu     $v1,0($a1)
818
        sb      $v1,0($a2)
819
        sb      $v0,0($a1)
820
        addu    $a2,$a2,1
821
.L99:
822
        addu    $a1,$a1,-1
823
.L100:
824
        sltu    $v0,$a2,$a1
825
        bne     $v0,$zero,.L97
826
        .set    noreorder
827
        .set    nomacro
828
        j       $ra
829
        move    $v0,$a0
830
        .set    macro
831
        .set    reorder
832
 
833
        .end    strrev
834
        .size   strrev,.-strrev
835
        .align  2
836
        .globl  itoa
837
        .ent    itoa
838
itoa:
839
        .frame  $sp,24,$ra              # vars= 0, regs= 1/0, args= 16, extra= 0
840
        .mask   0x80000000,-8
841
        .fmask  0x00000000,0
842
        subu    $sp,$sp,24
843
        .set    noreorder
844
        .set    nomacro
845
        bgez    $a0,.L103
846
        sw      $ra,16($sp)
847
        .set    macro
848
        .set    reorder
849
 
850
        li      $v0,45                  # 0x0000002d
851
        sb      $v0,0($a1)
852
        addu    $a1,$a1,1
853
        subu    $a0,$zero,$a0
854
.L103:
855
        .set    noreorder
856
        .set    nomacro
857
        beq     $a0,$zero,.L105
858
        move    $a3,$a1
859
        .set    macro
860
        .set    reorder
861
 
862
        li      $t0,1717960704                  # 0x66660000
863
        ori     $t0,$t0,0x6667
864
.L106:
865
        mult    $a0,$t0
866
        mfhi    $t1
867
        sra     $v1,$t1,2
868
        sra     $v0,$a0,31
869
        subu    $a2,$v1,$v0
870
        move    $v1,$a2
871
        sll     $v0,$a2,2
872
        addu    $v0,$v0,$a2
873
        sll     $v0,$v0,1
874
        subu    $a2,$a0,$v0
875
        addu    $v0,$a2,48
876
        sb      $v0,0($a3)
877
        move    $a0,$v1
878
        .set    noreorder
879
        .set    nomacro
880
        bne     $a0,$zero,.L106
881
        addu    $a3,$a3,1
882
        .set    macro
883
        .set    reorder
884
 
885
.L105:
886
        .set    noreorder
887
        .set    nomacro
888
        bne     $a1,$a3,.L108
889
        li      $v0,48                  # 0x00000030
890
        .set    macro
891
        .set    reorder
892
 
893
        sb      $v0,0($a1)
894
        addu    $a3,$a1,1
895
.L108:
896
        sb      $zero,0($a3)
897
        .set    noreorder
898
        .set    nomacro
899
        jal     strrev
900
        move    $a0,$a1
901
        .set    macro
902
        .set    reorder
903
 
904
        lw      $ra,16($sp)
905
        .set    noreorder
906
        .set    nomacro
907
        j       $ra
908
        addu    $sp,$sp,24
909
        .set    macro
910
        .set    reorder
911
 
912
        .end    itoa
913
        .size   itoa,.-itoa
914
        .align  2
915
        .globl  calculator
916
        .ent    calculator
917
calculator:
918
        .frame  $sp,32,$ra              # vars= 0, regs= 3/0, args= 16, extra= 0
919
        .mask   0x80030000,-8
920
        .fmask  0x00000000,0
921
        subu    $sp,$sp,32
922
        sw      $ra,24($sp)
923
        sw      $s1,20($sp)
924
        sw      $s0,16($sp)
925
        lui     $s0,%hi(buffer) # high
926
        addiu   $s0,$s0,%lo(buffer) # low
927
        sw      $s0,char_ptr
928
        jal     getsym
929
        jal     expression
930
        move    $s1,$v0
931
        .set    noreorder
932
        .set    nomacro
933
        jal     print_uart
934
        move    $a0,$s0
935
        .set    macro
936
        .set    reorder
937
 
938
        .set    noreorder
939
        .set    nomacro
940
        jal     putc_uart
941
        li      $a0,61                  # 0x0000003d
942
        .set    macro
943
        .set    reorder
944
 
945
        la      $a1,result_buffer
946
        .set    noreorder
947
        .set    nomacro
948
        jal     itoa
949
        move    $a0,$s1
950
        .set    macro
951
        .set    reorder
952
 
953
        la      $a0,result_buffer
954
        jal     print_uart
955
        .set    noreorder
956
        .set    nomacro
957
        jal     putc_uart
958
        li      $a0,10                  # 0x0000000a
959
        .set    macro
960
        .set    reorder
961
 
962
        .set    noreorder
963
        .set    nomacro
964
        jal     putc_uart
965
        li      $a0,10                  # 0x0000000a
966
        .set    macro
967
        .set    reorder
968
 
969
        .set    noreorder
970
        .set    nomacro
971
        jal     putc_uart
972
        li      $a0,13                  # 0x0000000d
973
        .set    macro
974
        .set    reorder
975
 
976
        lw      $ra,24($sp)
977
        lw      $s1,20($sp)
978
        lw      $s0,16($sp)
979
        .set    noreorder
980
        .set    nomacro
981
        j       $ra
982
        addu    $sp,$sp,32
983
        .set    macro
984
        .set    reorder
985
 
986
        .end    calculator
987
        .size   calculator,.-calculator
988
        .align  2
989
        .globl  strcpy
990
        .ent    strcpy
991
strcpy:
992
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
993
        .mask   0x00000000,0
994
        .fmask  0x00000000,0
995
        lbu     $v0,0($a1)
996
        .set    noreorder
997
        .set    nomacro
998
        beq     $v0,$zero,.L113
999
        move    $v1,$v0
1000
        .set    macro
1001
        .set    reorder
1002
 
1003
.L114:
1004
        sb      $v1,0($a0)
1005
        addu    $a1,$a1,1
1006
        lbu     $v1,0($a1)
1007
        .set    noreorder
1008
        .set    nomacro
1009
        bne     $v1,$zero,.L114
1010
        addu    $a0,$a0,1
1011
        .set    macro
1012
        .set    reorder
1013
 
1014
.L113:
1015
        .set    noreorder
1016
        .set    nomacro
1017
        j       $ra
1018
        sb      $zero,0($a0)
1019
        .set    macro
1020
        .set    reorder
1021
 
1022
        .end    strcpy
1023
        .size   strcpy,.-strcpy
1024
        .align  2
1025
        .globl  calculator_test
1026
        .ent    calculator_test
1027
calculator_test:
1028
        .frame  $sp,24,$ra              # vars= 0, regs= 1/0, args= 16, extra= 0
1029
        .mask   0x80000000,-8
1030
        .fmask  0x00000000,0
1031
        subu    $sp,$sp,24
1032
        sw      $ra,16($sp)
1033
        move    $a1,$a0
1034
        lui     $a0,%hi(buffer) # high
1035
        .set    noreorder
1036
        .set    nomacro
1037
        jal     strcpy
1038
        addiu   $a0,$a0,%lo(buffer) # low
1039
        .set    macro
1040
        .set    reorder
1041
 
1042
        jal     calculator
1043
        lw      $ra,16($sp)
1044
        .set    noreorder
1045
        .set    nomacro
1046
        j       $ra
1047
        addu    $sp,$sp,24
1048
        .set    macro
1049
        .set    reorder
1050
 
1051
        .end    calculator_test
1052
        .size   calculator_test,.-calculator_test
1053
        .text
1054
        .align  2
1055
        .globl  main2
1056
        .ent    main2
1057
main2:
1058
        .frame  $sp,24,$ra              # vars= 0, regs= 1/0, args= 16, extra= 0
1059
        .mask   0x80000000,-8
1060
        .fmask  0x00000000,0
1061
        subu    $sp,$sp,24
1062
        sw      $ra,16($sp)
1063
        li      $v1,16376                       # 0x00003ff8
1064
        lui     $v0,%hi(interrupt) # high
1065
        addiu   $v0,$v0,%lo(interrupt) # low
1066
        #.set   volatile
1067
        sw      $v0,0($v1)
1068
        #.set   novolatile
1069
        lui     $v0,%hi(buffer) # high
1070
        addiu   $v0,$v0,%lo(buffer) # low
1071
        sw      $v0,read_ptr
1072
        .set    noreorder
1073
        .set    nomacro
1074
        jal     putc_uart
1075
        li      $a0,10                  # 0x0000000a
1076
        .set    macro
1077
        .set    reorder
1078
 
1079
        .set    noreorder
1080
        .set    nomacro
1081
        jal     putc_uart
1082
        li      $a0,13                  # 0x0000000d
1083
        .set    macro
1084
        .set    reorder
1085
 
1086
        lui     $a0,%hi(.LC3) # high
1087
        .set    noreorder
1088
        .set    nomacro
1089
        jal     print_uart
1090
        addiu   $a0,$a0,%lo(.LC3) # low
1091
        .set    macro
1092
        .set    reorder
1093
 
1094
        .set    noreorder
1095
        .set    nomacro
1096
        jal     putc_uart
1097
        li      $a0,10                  # 0x0000000a
1098
        .set    macro
1099
        .set    reorder
1100
 
1101
        .set    noreorder
1102
        .set    nomacro
1103
        jal     putc_uart
1104
        li      $a0,13                  # 0x0000000d
1105
        .set    macro
1106
        .set    reorder
1107
 
1108
        lui     $a0,%hi(.LC4) # high
1109
.L122:
1110
        .set    noreorder
1111
        .set    nomacro
1112
        jal     print_uart
1113
        addiu   $a0,$a0,%lo(.LC4) # low
1114
        .set    macro
1115
        .set    reorder
1116
 
1117
.L119:
1118
        #.set   volatile
1119
        lw      $v0,int_flag
1120
        #.set   novolatile
1121
        beq     $v0,$zero,.L119
1122
        #.set   volatile
1123
        sw      $zero,int_flag
1124
        #.set   novolatile
1125
        jal     calculator
1126
        .set    noreorder
1127
        .set    nomacro
1128
        b       .L122
1129
        lui     $a0,%hi(.LC4) # high
1130
        .set    macro
1131
        .set    reorder
1132
 
1133
        .end    main2
1134
        .size   main2,.-main2
1135
        .align  2
1136
        .globl  set_interrupt_address
1137
        .ent    set_interrupt_address
1138
set_interrupt_address:
1139
        .frame  $sp,0,$ra                # vars= 0, regs= 0/0, args= 0, extra= 0
1140
        .mask   0x00000000,0
1141
        .fmask  0x00000000,0
1142
        li      $v0,16376                       # 0x00003ff8
1143
        lui     $v1,%hi(interrupt) # high
1144
        addiu   $v1,$v1,%lo(interrupt) # low
1145
        #.set   volatile
1146
        sw      $v1,0($v0)
1147
        #.set   novolatile
1148
        lui     $v0,%hi(buffer) # high
1149
        addiu   $v0,$v0,%lo(buffer) # low
1150
        sw      $v0,read_ptr
1151
        j       $ra
1152
        .end    set_interrupt_address
1153
        .size   set_interrupt_address,.-set_interrupt_address
1154
        .align  2
1155
        .globl  init_parser
1156
        .ent    init_parser
1157
init_parser:
1158
        .frame  $sp,24,$ra              # vars= 0, regs= 1/0, args= 16, extra= 0
1159
        .mask   0x80000000,-8
1160
        .fmask  0x00000000,0
1161
        subu    $sp,$sp,24
1162
        sw      $ra,16($sp)
1163
        lui     $v0,%hi(buffer) # high
1164
        addiu   $v0,$v0,%lo(buffer) # low
1165
        sw      $v0,char_ptr
1166
        jal     getsym
1167
        lw      $ra,16($sp)
1168
        .set    noreorder
1169
        .set    nomacro
1170
        j       $ra
1171
        addu    $sp,$sp,24
1172
        .set    macro
1173
        .set    reorder
1174
 
1175
        .end    init_parser
1176
        .size   init_parser,.-init_parser
1177
        .align  2
1178
        .globl  parse_error
1179
        .ent    parse_error
1180
parse_error:
1181
        .frame  $sp,24,$ra              # vars= 0, regs= 1/0, args= 16, extra= 0
1182
        .mask   0x80000000,-8
1183
        .fmask  0x00000000,0
1184
        subu    $sp,$sp,24
1185
        sw      $ra,16($sp)
1186
        lui     $a0,%hi(.LC2) # high
1187
        .set    noreorder
1188
        .set    nomacro
1189
        jal     print_uart
1190
        addiu   $a0,$a0,%lo(.LC2) # low
1191
        .set    macro
1192
        .set    reorder
1193
 
1194
        move    $v0,$zero
1195
        lw      $ra,16($sp)
1196
        .set    noreorder
1197
        .set    nomacro
1198
        j       $ra
1199
        addu    $sp,$sp,24
1200
        .set    macro
1201
        .set    reorder
1202
 
1203
        .end    parse_error
1204
        .size   parse_error,.-parse_error

powered by: WebSVN 2.1.0

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