Mercurial > repos > tabletprog
comparison modules/il.tp @ 356:3b023e5a0b42
llcompile almost working well enough for fib sample
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 15 Apr 2015 23:03:24 -0700 |
parents | a6cdcc1b1c02 |
children | 06dceff348ea |
comparison
equal
deleted
inserted
replaced
355:0b4d4f06bf91 | 356:3b023e5a0b42 |
---|---|
450 } | 450 } |
451 } | 451 } |
452 } | 452 } |
453 skipIf:else <- :_cond _toskip :_else { | 453 skipIf:else <- :_cond _toskip :_else { |
454 #{ | 454 #{ |
455 opcode <- { _skipif } | 455 opcode <- { _skipifelse } |
456 toskip <- { _toskip } | 456 toskip <- { _toskip } |
457 else <- { _else } | 457 else <- { _else } |
458 cond <- { _cond } | 458 cond <- { _cond } |
459 numops <- { 0 } | 459 numops <- { 0 } |
460 name <- { _names get: _skipifelse } | 460 name <- { _names get: _skipifelse } |
741 } | 741 } |
742 labels <- prepped map: :_ { | 742 labels <- prepped map: :_ { |
743 backend label | 743 backend label |
744 } | 744 } |
745 outprog <- #[] | 745 outprog <- #[] |
746 //translate main first so it's at the start of the output | |
747 prepped ifget: "main" :instarr { | |
748 outprog append: (labels get: "main" else: { false }) | |
749 foreach: instarr :_ inst { | |
750 print: "Translating: " . inst . "\n" | |
751 backend convertIL: inst to: outprog withLabels: labels | |
752 } | |
753 } else: {} | |
754 | |
746 foreach: prepped :name instarr { | 755 foreach: prepped :name instarr { |
747 outprog append: (labels get: name else: { false }) | 756 outprog append: (labels get: name else: { false }) |
748 foreach: instarr :_ inst { | 757 foreach: instarr :_ inst { |
749 print: "Translating: " . inst . "\n" | 758 print: "Translating: " . inst . "\n" |
750 backend convertIL: inst to: outprog withLabels: labels | 759 backend convertIL: inst to: outprog withLabels: labels |