-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsjp29
executable file
·1191 lines (1154 loc) · 41.7 KB
/
sjp29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1: PROGRAM
2: VARS
3: f INT
4: f1 INT
5: f2 INT
6: f3 INT
7: m INT
8: r INT
9: aux INT
10: ENDVARS
11:
12: PROCEDURE fact(VAL n INT, REF z INT, REF f INT)
13: PROCEDURE mult(REF a INT, REF b INT, REF p INT)
14: IF a=0 THEN p:=0
15: ELSE IF a>0 THEN a:=a-1
16: mult(a,b,p)
17: p:=p+b
18: ENDIF
19: ENDIF
20: ENDPROCEDURE
21: PROCEDURE gfact(VAL y INT, VAL w INT, VAL n INT, REF f INT)
22: VARS
23: p INT
24: aux INT
25: ENDVARS
26: IF y=0 THEN f:=w
27: ELSE IF y>0 THEN aux:=y
28: mult(y,w,p)
29: y:=aux
30: gfact(y-1,p,n,f)
31: ENDIF
32: ENDIF
33: ENDPROCEDURE
34: gfact(n,1,z,f)
35: ENDPROCEDURE
36:
37: PROCEDURE F(VAL n INT, REF f1 INT, REF f2 INT, REF f3 INT, VAL f4 INT)
38: PROCEDURE fibon(VAL n INT, REF f INT, REF f1 INT)
39: IF n=1 THEN f:=1 f1:=0
40: ELSE IF n>1 THEN
41: fibon(n-1,f,f1)
42: aux:=f
43: f:=aux+f1
44: f1:=aux
45: ENDIF
46: ENDIF
47: ENDPROCEDURE
48:
49: PROCEDURE fibon2(VAL n INT, REF f INT)
50: VARS
51: f1 INT
52: f2 INT
53: ENDVARS
54: IF n=0 THEN f:=0
55: ELSE IF n=1 THEN f:=1
56: ELSE IF n>1 THEN
57: fibon2(n-1,f1)
58: fibon2(n-2,f2)
59: f:=f1+f2
60: ENDIF
61: ENDIF
62: ENDIF
63: ENDPROCEDURE
64:
65: fibon(n,f1,f2)
66: fibon2(n,f4)
67: f3:=f4
68: ENDPROCEDURE
69:
70: PROCEDURE trad(VAL n INT, REF m INT)
71: PROCEDURE dividir(VAL a INT, VAL b INT, REF c INT, REF r INT)
72: IF a<b THEN c:=0 r:=a
73: ELSE
74: dividir(a,2*b,c,r)
75: IF r<b THEN c:=2*c
76: ELSE c:=2*c+1
77: r:=r-b
78: ENDIF
79: ENDIF
80: ENDPROCEDURE
81: PROCEDURE gtrad(VAL u INT, VAL v INT, VAL w INT, VAL q INT, REF m INT)
82: IF w=0 THEN m:=u
83: ELSE IF w>0 THEN
84: dividir(w,2,q,r)
85: gtrad(u+v*r, v*10, q,q,m)
86: ENDIF
87: ENDIF
88: ENDPROCEDURE
89: m:=0
90: gtrad(m,m+1,n,m,m)
91: ENDPROCEDURE
92:
93: aux:=6
94: fact(aux,aux,f)
95: WRITELN(f)
96:
97: F(8,f1,f2,f3,96)
98: IF f1=f3 THEN
99: WRITE(f1) WRITE(" ") WRITELN(f2)
100: ENDIF
101:
102: trad(19,m)
103: WRITELN(m)
104: ENDPROGRAM
105:
program
\__list
| \__ident(f)
| | \__int
| \__ident(f1)
| | \__int
| \__ident(f2)
| | \__int
| \__ident(f3)
| | \__int
| \__ident(m)
| | \__int
| \__ident(r)
| | \__int
| \__ident(aux)
| \__int
\__list
| \__procedure
| | \__ident(fact)
| | | \__list
| | | \__val
| | | | \__ident(n)
| | | | \__int
| | | \__ref
| | | | \__ident(z)
| | | | \__int
| | | \__ref
| | | \__ident(f)
| | | \__int
| | \__list
| | \__list
| | | \__procedure
| | | | \__ident(mult)
| | | | | \__list
| | | | | \__ref
| | | | | | \__ident(a)
| | | | | | \__int
| | | | | \__ref
| | | | | | \__ident(b)
| | | | | | \__int
| | | | | \__ref
| | | | | \__ident(p)
| | | | | \__int
| | | | \__list
| | | | \__list
| | | | \__list
| | | | \__if
| | | | \__=
| | | | | \__ident(a)
| | | | | \__intconst(0)
| | | | \__list
| | | | | \__:=
| | | | | \__ident(p)
| | | | | \__intconst(0)
| | | | \__list
| | | | \__if
| | | | \__>
| | | | | \__ident(a)
| | | | | \__intconst(0)
| | | | \__list
| | | | \__:=
| | | | | \__ident(a)
| | | | | \__-
| | | | | \__ident(a)
| | | | | \__intconst(1)
| | | | \__(
| | | | | \__ident(mult)
| | | | | \__list
| | | | | \__ident(a)
| | | | | \__ident(b)
| | | | | \__ident(p)
| | | | \__:=
| | | | \__ident(p)
| | | | \__+
| | | | \__ident(p)
| | | | \__ident(b)
| | | \__procedure
| | | \__ident(gfact)
| | | | \__list
| | | | \__val
| | | | | \__ident(y)
| | | | | \__int
| | | | \__val
| | | | | \__ident(w)
| | | | | \__int
| | | | \__val
| | | | | \__ident(n)
| | | | | \__int
| | | | \__ref
| | | | \__ident(f)
| | | | \__int
| | | \__list
| | | | \__ident(p)
| | | | | \__int
| | | | \__ident(aux)
| | | | \__int
| | | \__list
| | | \__list
| | | \__if
| | | \__=
| | | | \__ident(y)
| | | | \__intconst(0)
| | | \__list
| | | | \__:=
| | | | \__ident(f)
| | | | \__ident(w)
| | | \__list
| | | \__if
| | | \__>
| | | | \__ident(y)
| | | | \__intconst(0)
| | | \__list
| | | \__:=
| | | | \__ident(aux)
| | | | \__ident(y)
| | | \__(
| | | | \__ident(mult)
| | | | \__list
| | | | \__ident(y)
| | | | \__ident(w)
| | | | \__ident(p)
| | | \__:=
| | | | \__ident(y)
| | | | \__ident(aux)
| | | \__(
| | | \__ident(gfact)
| | | \__list
| | | \__-
| | | | \__ident(y)
| | | | \__intconst(1)
| | | \__ident(p)
| | | \__ident(n)
| | | \__ident(f)
| | \__list
| | \__(
| | \__ident(gfact)
| | \__list
| | \__ident(n)
| | \__intconst(1)
| | \__ident(z)
| | \__ident(f)
| \__procedure
| | \__ident(F)
| | | \__list
| | | \__val
| | | | \__ident(n)
| | | | \__int
| | | \__ref
| | | | \__ident(f1)
| | | | \__int
| | | \__ref
| | | | \__ident(f2)
| | | | \__int
| | | \__ref
| | | | \__ident(f3)
| | | | \__int
| | | \__val
| | | \__ident(f4)
| | | \__int
| | \__list
| | \__list
| | | \__procedure
| | | | \__ident(fibon)
| | | | | \__list
| | | | | \__val
| | | | | | \__ident(n)
| | | | | | \__int
| | | | | \__ref
| | | | | | \__ident(f)
| | | | | | \__int
| | | | | \__ref
| | | | | \__ident(f1)
| | | | | \__int
| | | | \__list
| | | | \__list
| | | | \__list
| | | | \__if
| | | | \__=
| | | | | \__ident(n)
| | | | | \__intconst(1)
| | | | \__list
| | | | | \__:=
| | | | | | \__ident(f)
| | | | | | \__intconst(1)
| | | | | \__:=
| | | | | \__ident(f1)
| | | | | \__intconst(0)
| | | | \__list
| | | | \__if
| | | | \__>
| | | | | \__ident(n)
| | | | | \__intconst(1)
| | | | \__list
| | | | \__(
| | | | | \__ident(fibon)
| | | | | \__list
| | | | | \__-
| | | | | | \__ident(n)
| | | | | | \__intconst(1)
| | | | | \__ident(f)
| | | | | \__ident(f1)
| | | | \__:=
| | | | | \__ident(aux)
| | | | | \__ident(f)
| | | | \__:=
| | | | | \__ident(f)
| | | | | \__+
| | | | | \__ident(aux)
| | | | | \__ident(f1)
| | | | \__:=
| | | | \__ident(f1)
| | | | \__ident(aux)
| | | \__procedure
| | | \__ident(fibon2)
| | | | \__list
| | | | \__val
| | | | | \__ident(n)
| | | | | \__int
| | | | \__ref
| | | | \__ident(f)
| | | | \__int
| | | \__list
| | | | \__ident(f1)
| | | | | \__int
| | | | \__ident(f2)
| | | | \__int
| | | \__list
| | | \__list
| | | \__if
| | | \__=
| | | | \__ident(n)
| | | | \__intconst(0)
| | | \__list
| | | | \__:=
| | | | \__ident(f)
| | | | \__intconst(0)
| | | \__list
| | | \__if
| | | \__=
| | | | \__ident(n)
| | | | \__intconst(1)
| | | \__list
| | | | \__:=
| | | | \__ident(f)
| | | | \__intconst(1)
| | | \__list
| | | \__if
| | | \__>
| | | | \__ident(n)
| | | | \__intconst(1)
| | | \__list
| | | \__(
| | | | \__ident(fibon2)
| | | | \__list
| | | | \__-
| | | | | \__ident(n)
| | | | | \__intconst(1)
| | | | \__ident(f1)
| | | \__(
| | | | \__ident(fibon2)
| | | | \__list
| | | | \__-
| | | | | \__ident(n)
| | | | | \__intconst(2)
| | | | \__ident(f2)
| | | \__:=
| | | \__ident(f)
| | | \__+
| | | \__ident(f1)
| | | \__ident(f2)
| | \__list
| | \__(
| | | \__ident(fibon)
| | | \__list
| | | \__ident(n)
| | | \__ident(f1)
| | | \__ident(f2)
| | \__(
| | | \__ident(fibon2)
| | | \__list
| | | \__ident(n)
| | | \__ident(f4)
| | \__:=
| | \__ident(f3)
| | \__ident(f4)
| \__procedure
| \__ident(trad)
| | \__list
| | \__val
| | | \__ident(n)
| | | \__int
| | \__ref
| | \__ident(m)
| | \__int
| \__list
| \__list
| | \__procedure
| | | \__ident(dividir)
| | | | \__list
| | | | \__val
| | | | | \__ident(a)
| | | | | \__int
| | | | \__val
| | | | | \__ident(b)
| | | | | \__int
| | | | \__ref
| | | | | \__ident(c)
| | | | | \__int
| | | | \__ref
| | | | \__ident(r)
| | | | \__int
| | | \__list
| | | \__list
| | | \__list
| | | \__if
| | | \__<
| | | | \__ident(a)
| | | | \__ident(b)
| | | \__list
| | | | \__:=
| | | | | \__ident(c)
| | | | | \__intconst(0)
| | | | \__:=
| | | | \__ident(r)
| | | | \__ident(a)
| | | \__list
| | | \__(
| | | | \__ident(dividir)
| | | | \__list
| | | | \__ident(a)
| | | | \__*
| | | | | \__intconst(2)
| | | | | \__ident(b)
| | | | \__ident(c)
| | | | \__ident(r)
| | | \__if
| | | \__<
| | | | \__ident(r)
| | | | \__ident(b)
| | | \__list
| | | | \__:=
| | | | \__ident(c)
| | | | \__*
| | | | \__intconst(2)
| | | | \__ident(c)
| | | \__list
| | | \__:=
| | | | \__ident(c)
| | | | \__+
| | | | \__*
| | | | | \__intconst(2)
| | | | | \__ident(c)
| | | | \__intconst(1)
| | | \__:=
| | | \__ident(r)
| | | \__-
| | | \__ident(r)
| | | \__ident(b)
| | \__procedure
| | \__ident(gtrad)
| | | \__list
| | | \__val
| | | | \__ident(u)
| | | | \__int
| | | \__val
| | | | \__ident(v)
| | | | \__int
| | | \__val
| | | | \__ident(w)
| | | | \__int
| | | \__val
| | | | \__ident(q)
| | | | \__int
| | | \__ref
| | | \__ident(m)
| | | \__int
| | \__list
| | \__list
| | \__list
| | \__if
| | \__=
| | | \__ident(w)
| | | \__intconst(0)
| | \__list
| | | \__:=
| | | \__ident(m)
| | | \__ident(u)
| | \__list
| | \__if
| | \__>
| | | \__ident(w)
| | | \__intconst(0)
| | \__list
| | \__(
| | | \__ident(dividir)
| | | \__list
| | | \__ident(w)
| | | \__intconst(2)
| | | \__ident(q)
| | | \__ident(r)
| | \__(
| | \__ident(gtrad)
| | \__list
| | \__+
| | | \__ident(u)
| | | \__*
| | | \__ident(v)
| | | \__ident(r)
| | \__*
| | | \__ident(v)
| | | \__intconst(10)
| | \__ident(q)
| | \__ident(q)
| | \__ident(m)
| \__list
| \__:=
| | \__ident(m)
| | \__intconst(0)
| \__(
| \__ident(gtrad)
| \__list
| \__ident(m)
| \__+
| | \__ident(m)
| | \__intconst(1)
| \__ident(n)
| \__ident(m)
| \__ident(m)
\__list
\__:=
| \__ident(aux)
| \__intconst(6)
\__(
| \__ident(fact)
| \__list
| \__ident(aux)
| \__ident(aux)
| \__ident(f)
\__writeln
| \__ident(f)
\__(
| \__ident(F)
| \__list
| \__intconst(8)
| \__ident(f1)
| \__ident(f2)
| \__ident(f3)
| \__intconst(96)
\__if
| \__=
| | \__ident(f1)
| | \__ident(f3)
| \__list
| \__write
| | \__ident(f1)
| \__write
| | \__string(" ")
| \__writeln
| \__ident(f2)
\__(
| \__ident(trad)
| \__list
| \__intconst(19)
| \__ident(m)
\__writeln
\__ident(m)
Type Checking:
Generating code:
program
parameters
static_link
endparameters
variables
_f 4
_f1 4
_f2 4
_f3 4
_m 4
_r 4
_aux 4
endvariables
aload _aux t0
iload 6 t1
stor t1 t0
load _aux t0
pushparam t0
aload _aux t0
pushparam t0
aload _f t0
pushparam t0
aload static_link t0
pushparam t0
call program_fact
killparam
killparam
killparam
killparam
load _f t0
wrii t0
wrln
iload 8 t0
pushparam t0
aload _f1 t0
pushparam t0
aload _f2 t0
pushparam t0
aload _f3 t0
pushparam t0
iload 96 t0
pushparam t0
aload static_link t0
pushparam t0
call program_F
killparam
killparam
killparam
killparam
killparam
killparam
load _f1 t0
load _f3 t1
equi t0 t1 t0
fjmp t0 endif_1
load _f1 t0
wrii t0
wris " "
load _f2 t0
wrii t0
wrln
etiq endif_1
iload 19 t0
pushparam t0
aload _m t0
pushparam t0
aload static_link t0
pushparam t0
call program_trad
killparam
killparam
killparam
load _m t0
wrii t0
wrln
stop
endprogram
subroutine program_fact_mult
parameters
_a
_b
_p
static_link
endparameters
variables
endvariables
load _a t0
load t0 t0
iload 0 t1
equi t0 t1 t0
fjmp t0 else_1
load _p t0
iload 0 t1
stor t1 t0
ujmp endif_1
etiq else_1
load _a t0
load t0 t0
iload 0 t1
grti t0 t1 t0
fjmp t0 endif_2
load _a t0
load _a t1
load t1 t1
iload 1 t2
subi t1 t2 t1
stor t1 t0
load _a t0
pushparam t0
load _b t0
pushparam t0
load _p t0
pushparam t0
load static_link t0
pushparam t0
call program_fact_mult
killparam
killparam
killparam
killparam
load _p t0
load _p t1
load t1 t1
load _b t2
load t2 t2
addi t1 t2 t1
stor t1 t0
etiq endif_2
etiq endif_1
retu
endsubroutine
subroutine program_fact_gfact
parameters
_y
_w
_n
_f
static_link
endparameters
variables
_p 4
_aux 4
endvariables
load _y t0
iload 0 t1
equi t0 t1 t0
fjmp t0 else_1
load _f t0
load _w t1
stor t1 t0
ujmp endif_1
etiq else_1
load _y t0
iload 0 t1
grti t0 t1 t0
fjmp t0 endif_2
aload _aux t0
load _y t1
stor t1 t0
aload _y t0
pushparam t0
aload _w t0
pushparam t0
aload _p t0
pushparam t0
load static_link t0
pushparam t0
call program_fact_mult
killparam
killparam
killparam
killparam
aload _y t0
load _aux t1
stor t1 t0
load _y t0
iload 1 t1
subi t0 t1 t0
pushparam t0
load _p t0
pushparam t0
load _n t0
pushparam t0
load _f t0
pushparam t0
load static_link t0
pushparam t0
call program_fact_gfact
killparam
killparam
killparam
killparam
killparam
etiq endif_2
etiq endif_1
retu
endsubroutine
subroutine program_fact
parameters
_n
_z
_f
static_link
endparameters
variables
endvariables
load _n t0
pushparam t0
iload 1 t0
pushparam t0
load _z t0
load t0 t0
pushparam t0
load _f t0
pushparam t0
aload static_link t0
pushparam t0
call program_fact_gfact
killparam
killparam
killparam
killparam
killparam
retu
endsubroutine
subroutine program_F_fibon
parameters
_n
_f
_f1
static_link
endparameters
variables
endvariables
load _n t0
iload 1 t1
equi t0 t1 t0
fjmp t0 else_1
load _f t0
iload 1 t1
stor t1 t0
load _f1 t0
iload 0 t1
stor t1 t0
ujmp endif_1
etiq else_1
load _n t0
iload 1 t1
grti t0 t1 t0
fjmp t0 endif_2
load _n t0
iload 1 t1
subi t0 t1 t0
pushparam t0
load _f t0
pushparam t0
load _f1 t0
pushparam t0
load static_link t0
pushparam t0
call program_F_fibon
killparam
killparam
killparam
killparam
load static_link t0
load t0 t0
addi t0 offset(program:_aux) t0
load _f t1
load t1 t1
stor t1 t0
load _f t0
load static_link t1
load t1 t1
addi t1 offset(program:_aux) t1
load t1 t1
load _f1 t2
load t2 t2
addi t1 t2 t1
stor t1 t0
load _f1 t0
load static_link t1
load t1 t1
addi t1 offset(program:_aux) t1
load t1 t1
stor t1 t0
etiq endif_2
etiq endif_1
retu
endsubroutine
subroutine program_F_fibon2
parameters
_n
_f
static_link
endparameters
variables
_f1 4
_f2 4
endvariables
load _n t0
iload 0 t1
equi t0 t1 t0
fjmp t0 else_1
load _f t0
iload 0 t1
stor t1 t0
ujmp endif_1
etiq else_1
load _n t0
iload 1 t1
equi t0 t1 t0
fjmp t0 else_2
load _f t0
iload 1 t1
stor t1 t0
ujmp endif_2
etiq else_2
load _n t0
iload 1 t1
grti t0 t1 t0
fjmp t0 endif_3
load _n t0
iload 1 t1
subi t0 t1 t0
pushparam t0
aload _f1 t0
pushparam t0
load static_link t0
pushparam t0
call program_F_fibon2
killparam
killparam
killparam
load _n t0
iload 2 t1
subi t0 t1 t0
pushparam t0
aload _f2 t0
pushparam t0
load static_link t0
pushparam t0
call program_F_fibon2
killparam
killparam
killparam
load _f t0
load _f1 t1
load _f2 t2
addi t1 t2 t1
stor t1 t0
etiq endif_3
etiq endif_2
etiq endif_1
retu
endsubroutine
subroutine program_F
parameters
_n
_f1
_f2
_f3
_f4
static_link
endparameters
variables
endvariables
load _n t0
pushparam t0
load _f1 t0
pushparam t0
load _f2 t0
pushparam t0
aload static_link t0
pushparam t0
call program_F_fibon
killparam
killparam
killparam
killparam
load _n t0
pushparam t0
aload _f4 t0
pushparam t0
aload static_link t0
pushparam t0
call program_F_fibon2
killparam
killparam
killparam
load _f3 t0
load _f4 t1
stor t1 t0
retu
endsubroutine
subroutine program_trad_dividir
parameters
_a
_b