about summary refs log tree commit diff stats
path: root/apps/tile/rpn.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-11-07 19:45:58 -0800
committerKartik Agaram <vc@akkartik.com>2020-11-07 19:45:58 -0800
commitf2a3c381a7eb9c454cabda8ffa54035a438313bf (patch)
tree53d967a71d04e7ae534646a6c42a6c3683348eb5 /apps/tile/rpn.mu
parent412304cf45ad4577b7e804b6a60c85f19c2b5e80 (diff)
downloadmu-f2a3c381a7eb9c454cabda8ffa54035a438313bf.tar.gz
7210
Bug fixed; I had to reinitialize the table of bindings.
Interesting debugging experience.
Diffstat (limited to 'apps/tile/rpn.mu')
-rw-r--r--apps/tile/rpn.mu12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/tile/rpn.mu b/apps/tile/rpn.mu
index ecde7f0e..2cb61757 100644
--- a/apps/tile/rpn.mu
+++ b/apps/tile/rpn.mu
@@ -278,6 +278,7 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
         allocate screen-ah
         var screen/eax: (addr screen) <- lookup screen-h
         initialize-screen screen, nrows, ncols
+#?         render-screen 0, 5, 5, screen
         # push screen to stack
         var data-ah/eax: (addr handle array value) <- get out2, data
         var data/eax: (addr array value) <- lookup *data-ah
@@ -408,6 +409,7 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
         var top-addr/ebx: (addr int) <- get out2, top
         compare *top-addr, 0
         break-if-<=
+#?         print-string 0, "DOWN\n"
         # pop args
         var _d/eax: int <- pop-int-from-value-stack out2
         var d/ecx: int <- copy _d
@@ -427,6 +429,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
         var target-ah/eax: (addr handle screen) <- get target-val, screen-data
         var _target/eax: (addr screen) <- lookup *target-ah
         var target/edi: (addr screen) <- copy _target
+#?         print-string 0, "before:\n"
+#?         render-screen 0, 5, 5, target
         var bound-a/ebx: (addr int) <- get target, num-rows
         var bound/ebx: int <- copy *bound-a
         var r/edx: (addr int) <- get target, cursor-row
@@ -443,6 +447,8 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
           d <- decrement
           loop
         }
+#?         print-string 0, "after:\n"
+#?         render-screen 0, 5, 5, target
         break $evaluate:process-word
       }
       {
@@ -606,6 +612,9 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
         top <- decrement
         var dest-offset/edx: (offset value) <- compute-offset data, top
         var target-val/edx: (addr value) <- index data, dest-offset
+#?         var tmp-ah/eax: (addr handle screen) <- get target-val, screen-data
+#?         var tmp/eax: (addr screen) <- lookup *tmp-ah
+#?         render-screen 0, 5, 5, tmp
         # create binding from curr-stream to target-val
         var key-h: (handle array byte)
         var key/ecx: (addr handle array byte) <- address key-h
@@ -640,6 +649,9 @@ fn evaluate functions: (addr handle function), bindings: (addr table), scratch:
         compare val, 0
         break-if-=
         push-value-stack out, val
+#?         var tmp-ah/eax: (addr handle screen) <- get val, screen-data
+#?         var tmp/eax: (addr screen) <- lookup *tmp-ah
+#?         render-screen 0, 5, 5, tmp
         break $evaluate:process-word
       }
       ### if the word starts with a quote and ends with a quote, turn it into a string