about summary refs log tree commit diff stats
path: root/prototypes
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-08-02 12:05:25 -0700
committerKartik Agaram <vc@akkartik.com>2020-08-02 15:11:52 -0700
commit0452b05f5a78b33d94352c676e021b4a1abfb5f2 (patch)
tree53ec02b7898b125b88e27121ee74f22456c524b4 /prototypes
parent1b79f705b9975a3293fd111c5dc129e887dc01c0 (diff)
downloadmu-0452b05f5a78b33d94352c676e021b4a1abfb5f2.tar.gz
6703 - new types: code-point and grapheme
Both have the same size: 4 bytes.

So far I've just renamed print-byte to print-grapheme, but it still behaves
the same.

I'm going to support printing code-points next, but grapheme 'clusters'
spanning multiple code-points won't be supported for some time.
Diffstat (limited to 'prototypes')
-rw-r--r--prototypes/browse/1-print-file.mu3
-rw-r--r--prototypes/browse/10.mu6
-rw-r--r--prototypes/browse/11.mu6
-rw-r--r--prototypes/browse/12.mu12
-rw-r--r--prototypes/browse/13.mu12
-rw-r--r--prototypes/browse/14.mu12
-rw-r--r--prototypes/browse/15-headers-broken.mu12
-rw-r--r--prototypes/browse/16-screen-state-broken.mu3
-rw-r--r--prototypes/browse/17-file-state-broken/file-state.mu3
-rw-r--r--prototypes/browse/18/file-state.mu3
-rw-r--r--prototypes/browse/18/main.mu3
-rw-r--r--prototypes/browse/19/file-state.mu3
-rw-r--r--prototypes/browse/19/screen-position-state.mu3
-rw-r--r--prototypes/browse/2.mu3
-rw-r--r--prototypes/browse/20/file-state.mu3
-rw-r--r--prototypes/browse/20/screen-position-state.mu3
-rw-r--r--prototypes/browse/21/file-state.mu3
-rw-r--r--prototypes/browse/21/screen-position-state.mu3
-rw-r--r--prototypes/browse/22/file-state.mu3
-rw-r--r--prototypes/browse/22/screen-position-state.mu3
-rw-r--r--prototypes/browse/23-multiple-pages/file-state.mu3
-rw-r--r--prototypes/browse/23-multiple-pages/screen-position-state.mu3
-rw-r--r--prototypes/browse/24-bold/file-state.mu3
-rw-r--r--prototypes/browse/24-bold/screen-position-state.mu3
-rw-r--r--prototypes/browse/25-soft-newlines/file-state.mu3
-rw-r--r--prototypes/browse/25-soft-newlines/screen-position-state.mu3
-rw-r--r--prototypes/browse/26-headers/file-state.mu3
-rw-r--r--prototypes/browse/26-headers/screen-position-state.mu3
-rw-r--r--prototypes/browse/27/file-state.mu3
-rw-r--r--prototypes/browse/27/screen-position-state.mu3
-rw-r--r--prototypes/browse/28/file-state.mu3
-rw-r--r--prototypes/browse/28/screen-position-state.mu3
-rw-r--r--prototypes/browse/29/file-state.mu3
-rw-r--r--prototypes/browse/29/screen-position-state.mu3
-rw-r--r--prototypes/browse/3.mu3
-rw-r--r--prototypes/browse/4-render-page.mu6
-rw-r--r--prototypes/browse/5.mu6
-rw-r--r--prototypes/browse/6.mu6
-rw-r--r--prototypes/browse/7.mu6
-rw-r--r--prototypes/browse/8-multiple-pages.mu6
-rw-r--r--prototypes/browse/9-bold.mu6
-rw-r--r--prototypes/tile/2.mu3
-rw-r--r--prototypes/tile/3.mu3
43 files changed, 126 insertions, 63 deletions
diff --git a/prototypes/browse/1-print-file.mu b/prototypes/browse/1-print-file.mu
index e89f1cec..8310fc0f 100644
--- a/prototypes/browse/1-print-file.mu
+++ b/prototypes/browse/1-print-file.mu
@@ -26,7 +26,8 @@ fn dump in: (addr buffered-file) {
     var c/eax: byte <- read-byte-buffered in
     compare c, 0xffffffff  # EOF marker
     break-if-=
-    print-byte 0, c
+    var g/eax: grapheme <- copy c
+    print-grapheme 0, g
     loop
   }
 }
diff --git a/prototypes/browse/10.mu b/prototypes/browse/10.mu
index 834fec90..5025cb7d 100644
--- a/prototypes/browse/10.mu
+++ b/prototypes/browse/10.mu
@@ -75,7 +75,8 @@ $line-loop: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -171,6 +172,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/11.mu b/prototypes/browse/11.mu
index 73e1b21e..af1ee45a 100644
--- a/prototypes/browse/11.mu
+++ b/prototypes/browse/11.mu
@@ -119,7 +119,8 @@ $update-attributes:check-state: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -167,6 +168,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/12.mu b/prototypes/browse/12.mu
index ec93564c..6b2780ec 100644
--- a/prototypes/browse/12.mu
+++ b/prototypes/browse/12.mu
@@ -98,7 +98,8 @@ $update-attributes:check-state: {
           {
             break-if-!=
             # r->current-state == 1 && c == '*' => print c, then normal text
-            print-byte 0, c
+            var g/eax: grapheme <- copy c
+            print-grapheme 0, g
             col <- increment
             reset-formatting 0
             start-color 0, 0xec, 7  # 236 = darkish gray
@@ -109,7 +110,8 @@ $update-attributes:check-state: {
           {
             break-if-!=
             # r->current-state == 1 && c == '_' => print c, then normal text
-            print-byte 0, c
+            var g/eax: grapheme <- copy c
+            print-grapheme 0, g
             col <- increment
             reset-formatting 0
             start-color 0, 0xec, 7  # 236 = darkish gray
@@ -122,7 +124,8 @@ $update-attributes:check-state: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -170,6 +173,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/13.mu b/prototypes/browse/13.mu
index c0371954..0dac8a4d 100644
--- a/prototypes/browse/13.mu
+++ b/prototypes/browse/13.mu
@@ -99,7 +99,8 @@ $update-attributes:check-state: {
           {
             break-if-!=
             # r->current-state == 1 && c == '*' => print c, then normal text
-            print-byte 0, c
+            var g/eax: grapheme <- copy c
+            print-grapheme 0, g
             col <- increment
             reset-formatting 0
             start-color 0, 0xec, 7  # 236 = darkish gray
@@ -110,7 +111,8 @@ $update-attributes:check-state: {
           {
             break-if-!=
             # r->current-state == 1 && c == '_' => print c, then normal text
-            print-byte 0, c
+            var g/eax: grapheme <- copy c
+            print-grapheme 0, g
             col <- increment
             reset-formatting 0
             start-color 0, 0xec, 7  # 236 = darkish gray
@@ -123,7 +125,8 @@ $update-attributes:check-state: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -171,6 +174,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/14.mu b/prototypes/browse/14.mu
index 0ad5d5c3..bccb9767 100644
--- a/prototypes/browse/14.mu
+++ b/prototypes/browse/14.mu
@@ -97,7 +97,8 @@ $change-state: {
           {
             break-if-!=
             # r->current-state == 1 && c == '*' => print c, then normal text
-            print-byte 0, c
+            var g/eax: grapheme <- copy c
+            print-grapheme 0, g
             col <- increment
             reset-formatting 0
             start-color 0, 0xec, 7  # 236 = darkish gray
@@ -108,7 +109,8 @@ $change-state: {
           {
             break-if-!=
             # r->current-state == 1 && c == '_' => print c, then normal text
-            print-byte 0, c
+            var g/eax: grapheme <- copy c
+            print-grapheme 0, g
             col <- increment
             reset-formatting 0
             start-color 0, 0xec, 7  # 236 = darkish gray
@@ -121,7 +123,8 @@ $change-state: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -169,6 +172,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/15-headers-broken.mu b/prototypes/browse/15-headers-broken.mu
index c9c722e4..73062bfc 100644
--- a/prototypes/browse/15-headers-broken.mu
+++ b/prototypes/browse/15-headers-broken.mu
@@ -121,7 +121,8 @@ $change-state: {
           {
             break-if-!=
             # r->current-state == 1 && c == '*' => print c, then normal text
-            print-byte 0, c
+            var g/eax: grapheme <- copy c
+            print-grapheme 0, g
             col <- increment
             reset-formatting 0
             start-color 0, 0xec, 7  # 236 = darkish gray
@@ -132,7 +133,8 @@ $change-state: {
           {
             break-if-!=
             # r->current-state == 1 && c == '_' => print c, then normal text
-            print-byte 0, c
+            var g/eax: grapheme <- copy c
+            print-grapheme 0, g
             col <- increment
             reset-formatting 0
             start-color 0, 0xec, 7  # 236 = darkish gray
@@ -163,7 +165,8 @@ $change-state: {
         copy-to *s, 0  # false
       }
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }
@@ -211,6 +214,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/16-screen-state-broken.mu b/prototypes/browse/16-screen-state-broken.mu
index 3ea359f2..9324244a 100644
--- a/prototypes/browse/16-screen-state-broken.mu
+++ b/prototypes/browse/16-screen-state-broken.mu
@@ -183,6 +183,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/17-file-state-broken/file-state.mu b/prototypes/browse/17-file-state-broken/file-state.mu
index cf39e9d8..c4339cef 100644
--- a/prototypes/browse/17-file-state-broken/file-state.mu
+++ b/prototypes/browse/17-file-state-broken/file-state.mu
@@ -28,6 +28,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/18/file-state.mu b/prototypes/browse/18/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/18/file-state.mu
+++ b/prototypes/browse/18/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/18/main.mu b/prototypes/browse/18/main.mu
index 4320a460..7a551e6c 100644
--- a/prototypes/browse/18/main.mu
+++ b/prototypes/browse/18/main.mu
@@ -19,7 +19,8 @@ fn render-normal fs: (addr file-state) {
     compare c, 0xffffffff  # EOF marker
     break-if-=
     #
-    print-byte 0, c
+    var g/eax: grapheme <- copy c
+    print-grapheme 0, g
     #
     loop
   }
diff --git a/prototypes/browse/19/file-state.mu b/prototypes/browse/19/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/19/file-state.mu
+++ b/prototypes/browse/19/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/19/screen-position-state.mu b/prototypes/browse/19/screen-position-state.mu
index 543f1871..06efa4ba 100644
--- a/prototypes/browse/19/screen-position-state.mu
+++ b/prototypes/browse/19/screen-position-state.mu
@@ -63,7 +63,8 @@ fn start-drawing _self: (addr screen-position-state) {
 fn add-char _self: (addr screen-position-state), c: byte {
   var self/esi: (addr screen-position-state) <- copy _self
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/2.mu b/prototypes/browse/2.mu
index 52245b6c..119e063a 100644
--- a/prototypes/browse/2.mu
+++ b/prototypes/browse/2.mu
@@ -25,7 +25,8 @@ fn dump in: (addr buffered-file) {
     var c/eax: byte <- read-byte-buffered in
     compare c, 0xffffffff  # EOF marker
     break-if-=
-    print-byte 0, c
+    var g/eax: grapheme <- copy c
+    print-grapheme 0, g
     loop
   }
 }
diff --git a/prototypes/browse/20/file-state.mu b/prototypes/browse/20/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/20/file-state.mu
+++ b/prototypes/browse/20/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/20/screen-position-state.mu b/prototypes/browse/20/screen-position-state.mu
index 41ad2705..2f61f3e7 100644
--- a/prototypes/browse/20/screen-position-state.mu
+++ b/prototypes/browse/20/screen-position-state.mu
@@ -71,7 +71,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/21/file-state.mu b/prototypes/browse/21/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/21/file-state.mu
+++ b/prototypes/browse/21/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/21/screen-position-state.mu b/prototypes/browse/21/screen-position-state.mu
index 2316d3ae..e740a141 100644
--- a/prototypes/browse/21/screen-position-state.mu
+++ b/prototypes/browse/21/screen-position-state.mu
@@ -70,7 +70,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/22/file-state.mu b/prototypes/browse/22/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/22/file-state.mu
+++ b/prototypes/browse/22/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/22/screen-position-state.mu b/prototypes/browse/22/screen-position-state.mu
index 245f834e..72b8e5b5 100644
--- a/prototypes/browse/22/screen-position-state.mu
+++ b/prototypes/browse/22/screen-position-state.mu
@@ -70,7 +70,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/23-multiple-pages/file-state.mu b/prototypes/browse/23-multiple-pages/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/23-multiple-pages/file-state.mu
+++ b/prototypes/browse/23-multiple-pages/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/23-multiple-pages/screen-position-state.mu b/prototypes/browse/23-multiple-pages/screen-position-state.mu
index 6fe1ad93..9fb410f8 100644
--- a/prototypes/browse/23-multiple-pages/screen-position-state.mu
+++ b/prototypes/browse/23-multiple-pages/screen-position-state.mu
@@ -71,7 +71,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/24-bold/file-state.mu b/prototypes/browse/24-bold/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/24-bold/file-state.mu
+++ b/prototypes/browse/24-bold/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/24-bold/screen-position-state.mu b/prototypes/browse/24-bold/screen-position-state.mu
index 6fe1ad93..9fb410f8 100644
--- a/prototypes/browse/24-bold/screen-position-state.mu
+++ b/prototypes/browse/24-bold/screen-position-state.mu
@@ -71,7 +71,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/25-soft-newlines/file-state.mu b/prototypes/browse/25-soft-newlines/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/25-soft-newlines/file-state.mu
+++ b/prototypes/browse/25-soft-newlines/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/25-soft-newlines/screen-position-state.mu b/prototypes/browse/25-soft-newlines/screen-position-state.mu
index dec8b502..7b53ae07 100644
--- a/prototypes/browse/25-soft-newlines/screen-position-state.mu
+++ b/prototypes/browse/25-soft-newlines/screen-position-state.mu
@@ -72,7 +72,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/26-headers/file-state.mu b/prototypes/browse/26-headers/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/26-headers/file-state.mu
+++ b/prototypes/browse/26-headers/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/26-headers/screen-position-state.mu b/prototypes/browse/26-headers/screen-position-state.mu
index dec8b502..7b53ae07 100644
--- a/prototypes/browse/26-headers/screen-position-state.mu
+++ b/prototypes/browse/26-headers/screen-position-state.mu
@@ -72,7 +72,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/27/file-state.mu b/prototypes/browse/27/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/27/file-state.mu
+++ b/prototypes/browse/27/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/27/screen-position-state.mu b/prototypes/browse/27/screen-position-state.mu
index dec8b502..7b53ae07 100644
--- a/prototypes/browse/27/screen-position-state.mu
+++ b/prototypes/browse/27/screen-position-state.mu
@@ -72,7 +72,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/28/file-state.mu b/prototypes/browse/28/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/28/file-state.mu
+++ b/prototypes/browse/28/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/28/screen-position-state.mu b/prototypes/browse/28/screen-position-state.mu
index dec8b502..7b53ae07 100644
--- a/prototypes/browse/28/screen-position-state.mu
+++ b/prototypes/browse/28/screen-position-state.mu
@@ -72,7 +72,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/29/file-state.mu b/prototypes/browse/29/file-state.mu
index 544c7832..d42bf8bf 100644
--- a/prototypes/browse/29/file-state.mu
+++ b/prototypes/browse/29/file-state.mu
@@ -39,6 +39,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/29/screen-position-state.mu b/prototypes/browse/29/screen-position-state.mu
index dec8b502..7b53ae07 100644
--- a/prototypes/browse/29/screen-position-state.mu
+++ b/prototypes/browse/29/screen-position-state.mu
@@ -72,7 +72,8 @@ $add-char:body: {
     break $add-char:body
   }
   # print c
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp
diff --git a/prototypes/browse/3.mu b/prototypes/browse/3.mu
index 297ce470..2938e9b1 100644
--- a/prototypes/browse/3.mu
+++ b/prototypes/browse/3.mu
@@ -24,6 +24,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/4-render-page.mu b/prototypes/browse/4-render-page.mu
index 130f17e5..f0473387 100644
--- a/prototypes/browse/4-render-page.mu
+++ b/prototypes/browse/4-render-page.mu
@@ -29,7 +29,8 @@ $line-loop: {
       compare c, 0xffffffff  # EOF marker
       break-if-= $line-loop
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -76,6 +77,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/5.mu b/prototypes/browse/5.mu
index 24a323a8..17a6e240 100644
--- a/prototypes/browse/5.mu
+++ b/prototypes/browse/5.mu
@@ -31,7 +31,8 @@ $line-loop: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -78,6 +79,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/6.mu b/prototypes/browse/6.mu
index cb7e55ee..bd51182b 100644
--- a/prototypes/browse/6.mu
+++ b/prototypes/browse/6.mu
@@ -42,7 +42,8 @@ $line-loop: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -89,6 +90,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/7.mu b/prototypes/browse/7.mu
index 0ea581a4..df89cd15 100644
--- a/prototypes/browse/7.mu
+++ b/prototypes/browse/7.mu
@@ -46,7 +46,8 @@ $line-loop: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -94,6 +95,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/8-multiple-pages.mu b/prototypes/browse/8-multiple-pages.mu
index e049fd37..78aba2f9 100644
--- a/prototypes/browse/8-multiple-pages.mu
+++ b/prototypes/browse/8-multiple-pages.mu
@@ -62,7 +62,8 @@ $line-loop: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -110,6 +111,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/browse/9-bold.mu b/prototypes/browse/9-bold.mu
index 2d7312aa..dec8e581 100644
--- a/prototypes/browse/9-bold.mu
+++ b/prototypes/browse/9-bold.mu
@@ -70,7 +70,8 @@ $line-loop: {
       compare c, 0xa  # newline
       break-if-=  # no need to print newlines
       # print c
-      print-byte 0, c
+      var g/eax: grapheme <- copy c
+      print-grapheme 0, g
       col <- increment
       loop
     }  # $char-loop
@@ -147,6 +148,7 @@ fn dump in: (addr buffered-file) {
   var c/eax: byte <- read-byte-buffered in
   compare c, 0xffffffff  # EOF marker
   break-if-=
-  print-byte 0, c
+  var g/eax: grapheme <- copy c
+  print-grapheme 0, g
   loop
 }
diff --git a/prototypes/tile/2.mu b/prototypes/tile/2.mu
index c6daa971..79b9ed99 100644
--- a/prototypes/tile/2.mu
+++ b/prototypes/tile/2.mu
@@ -76,7 +76,8 @@ $render:render-loop: {
       move-cursor 0, row, col
       loop $render:render-loop
     }
-    print-byte 0, c
+    var g/eax: grapheme <- copy c
+    print-grapheme 0, g
     col <- increment
     loop
   }
diff --git a/prototypes/tile/3.mu b/prototypes/tile/3.mu
index 8f234f21..94c9cc8c 100644
--- a/prototypes/tile/3.mu
+++ b/prototypes/tile/3.mu
@@ -68,7 +68,8 @@ $render:render-loop: {
       move-cursor 0, row, col
       loop $render:render-loop
     }
-    print-byte 0, c
+    var g/eax: grapheme <- copy c
+    print-grapheme 0, g
     col <- increment
     loop
   }