about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--shell/cell.mu2
-rw-r--r--shell/print.mu12
2 files changed, 14 insertions, 0 deletions
diff --git a/shell/cell.mu b/shell/cell.mu
index 11a16821..b2b302e6 100644
--- a/shell/cell.mu
+++ b/shell/cell.mu
@@ -121,6 +121,8 @@ fn allocate-screen _out: (addr handle cell) {
   var out/eax: (addr handle cell) <- copy _out
   allocate out
   var out-addr/eax: (addr cell) <- lookup *out
+  var dest-ah/ecx: (addr handle screen) <- get out-addr, screen-data
+  allocate dest-ah
   var type/ecx: (addr int) <- get out-addr, type
   copy-to *type, 5/screen
 }
diff --git a/shell/print.mu b/shell/print.mu
index 3dec6cff..307b9ffd 100644
--- a/shell/print.mu
+++ b/shell/print.mu
@@ -47,6 +47,18 @@ fn print-cell _in: (addr handle cell), out: (addr stream byte), trace: (addr tra
     trace-higher trace
     return
   }
+  compare *in-type, 5/primitive
+  {
+    break-if-!=
+    write out, "[screen "
+    var screen-ah/eax: (addr handle screen) <- get in-addr, screen-data
+    var screen/eax: (addr screen) <- lookup *screen-ah
+    var screen-addr/eax: int <- copy screen
+    write-int32-decimal out, screen-addr
+    write out, "]"
+    trace-higher trace
+    return
+  }
 }
 
 # debug helper