From 8bb5d26cf13efae2574cd8a2afea1812f4216539 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 1 Dec 2020 00:33:12 -0800 Subject: 7311 --- html/apps/tile/rpn.mu.html | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'html/apps/tile/rpn.mu.html') diff --git a/html/apps/tile/rpn.mu.html b/html/apps/tile/rpn.mu.html index 02d74cf5..afb4d47f 100644 --- a/html/apps/tile/rpn.mu.html +++ b/html/apps/tile/rpn.mu.html @@ -70,7 +70,7 @@ if ('onhashchange' in window) { 10 compare curr, 0 11 break-if-= 12 # update curr-stream - 13 emit-word curr, curr-stream + 13 emit-word curr, curr-stream 14 #? print-string-to-real-screen "eval: " 15 #? print-stream-to-real-screen curr-stream 16 #? print-string-to-real-screen "\n" @@ -699,10 +699,10 @@ if ('onhashchange' in window) { 639 var callee-h: (handle function) 640 var callee-ah/eax: (addr handle function) <- address callee-h 641 find-function functions, curr-stream, callee-ah -642 var callee/eax: (addr function) <- lookup *callee-ah -643 compare callee, 0 +642 var callee/eax: (addr function) <- lookup *callee-ah +643 compare callee, 0 644 break-if-= -645 perform-call callee, out, functions +645 perform-call callee, out, functions 646 break $evaluate:process-word 647 } 648 ### if it's a name, push its value @@ -753,7 +753,7 @@ if ('onhashchange' in window) { 693 var input/eax: (addr array byte) <- lookup *input-ah 694 var h2: (handle array int) 695 var int-array-ah/esi: (addr handle array int) <- address h2 -696 parse-array-of-decimal-ints input, int-array-ah # leak +696 parse-array-of-decimal-ints input, int-array-ah # leak 697 var _int-array/eax: (addr array int) <- lookup *int-array-ah 698 var int-array/esi: (addr array int) <- copy _int-array 699 var len/ebx: int <- length int-array @@ -810,13 +810,13 @@ if ('onhashchange' in window) { 750 var line-storage: line 751 var line/esi: (addr line) <- address line-storage 752 var first-word-ah/eax: (addr handle word) <- get line-storage, data -753 allocate-word-with first-word-ah, "3" -754 append-word-with *first-word-ah, "=a" +753 allocate-word-with first-word-ah, "3" +754 append-word-with *first-word-ah, "=a" 755 var next-line-ah/eax: (addr handle line) <- get line-storage, next 756 allocate next-line-ah 757 var next-line/eax: (addr line) <- lookup *next-line-ah 758 var first-word-ah/eax: (addr handle word) <- get next-line, data -759 allocate-word-with first-word-ah, "a" +759 allocate-word-with first-word-ah, "a" 760 var functions-storage: (handle function) 761 var functions/ecx: (addr handle function) <- address functions-storage 762 var table-storage: table @@ -853,14 +853,14 @@ if ('onhashchange' in window) { 793 } 794 795 fn perform-call _callee: (addr function), caller-stack: (addr value-stack), functions: (addr handle function) { -796 var callee/ecx: (addr function) <- copy _callee +796 var callee/ecx: (addr function) <- copy _callee 797 # create bindings for args 798 var table-storage: table 799 var table/esi: (addr table) <- address table-storage 800 initialize-table table, 0x10 -801 bind-args callee, caller-stack, table +801 bind-args callee, caller-stack, table 802 # obtain body -803 var body-ah/eax: (addr handle line) <- get callee, body +803 var body-ah/eax: (addr handle line) <- get callee, body 804 var body/eax: (addr line) <- lookup *body-ah 805 # perform call 806 var stack-storage: value-stack @@ -886,8 +886,8 @@ if ('onhashchange' in window) { 826 # pop args from the caller-stack and bind them to successive args 827 # implies: function args are stored in reverse order 828 fn bind-args _callee: (addr function), _caller-stack: (addr value-stack), table: (addr table) { -829 var callee/ecx: (addr function) <- copy _callee -830 var curr-arg-ah/eax: (addr handle word) <- get callee, args +829 var callee/ecx: (addr function) <- copy _callee +830 var curr-arg-ah/eax: (addr handle word) <- get callee, args 831 var curr-arg/eax: (addr word) <- lookup *curr-arg-ah 832 # 833 var curr-key-storage: (handle array byte) @@ -896,7 +896,7 @@ if ('onhashchange' in window) { 836 compare curr-arg, 0 837 break-if-= 838 # create binding -839 word-to-string curr-arg, curr-key +839 word-to-string curr-arg, curr-key 840 { 841 # pop target-val from caller-stack 842 var caller-stack/esi: (addr value-stack) <- copy _caller-stack @@ -921,29 +921,29 @@ if ('onhashchange' in window) { 861 862 # Copy of 'simplify' that just tracks the maximum stack depth needed 863 # Doesn't actually need to simulate the stack, since every word has a predictable effect. -864 fn max-stack-depth first-word: (addr word), final-word: (addr word) -> _/edi: int { -865 var curr-word/eax: (addr word) <- copy first-word +864 fn max-stack-depth first-word: (addr word), final-word: (addr word) -> _/edi: int { +865 var curr-word/eax: (addr word) <- copy first-word 866 var curr-depth/ecx: int <- copy 0 867 var result/edi: int <- copy 0 868 $max-stack-depth:loop: { 869 $max-stack-depth:process-word: { 870 # handle operators 871 { -872 var is-add?/eax: boolean <- word-equal? curr-word, "+" +872 var is-add?/eax: boolean <- word-equal? curr-word, "+" 873 compare is-add?, 0 874 break-if-= 875 curr-depth <- decrement 876 break $max-stack-depth:process-word 877 } 878 { -879 var is-sub?/eax: boolean <- word-equal? curr-word, "-" +879 var is-sub?/eax: boolean <- word-equal? curr-word, "-" 880 compare is-sub?, 0 881 break-if-= 882 curr-depth <- decrement 883 break $max-stack-depth:process-word 884 } 885 { -886 var is-mul?/eax: boolean <- word-equal? curr-word, "*" +886 var is-mul?/eax: boolean <- word-equal? curr-word, "*" 887 compare is-mul?, 0 888 break-if-= 889 curr-depth <- decrement @@ -959,7 +959,7 @@ if ('onhashchange' in window) { 899 } 900 } 901 # if curr-word == final-word break -902 compare curr-word, final-word +902 compare curr-word, final-word 903 break-if-= 904 # curr-word = curr-word->next 905 var next-word-ah/edx: (addr handle word) <- get curr-word, next -- cgit 1.4.1-2-gfad0