about summary refs log tree commit diff stats
path: root/405screen.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-11-25 22:56:03 -0800
committerKartik Agaram <vc@akkartik.com>2020-11-25 23:01:17 -0800
commit3ff2e99c0b9912adc7aad65ea9cea203663a4e1e (patch)
tree4eb4ad165fecd1cff31449ac19c10cec0d7f9108 /405screen.mu
parentb4932228ca6ea59177c20abd13d923b85a45332b (diff)
downloadmu-3ff2e99c0b9912adc7aad65ea9cea203663a4e1e.tar.gz
7272 - snapshot: printing floats in decimal
I've made some progress to where I can print whole integers right. But
this whole approach of mixing decimals with binary exponents is going to
be super confusing. I need to bite the bullet and just use decimal exponents.
Diffstat (limited to '405screen.mu')
-rw-r--r--405screen.mu13
1 files changed, 12 insertions, 1 deletions
diff --git a/405screen.mu b/405screen.mu
index e271bf79..0fd0f4e3 100644
--- a/405screen.mu
+++ b/405screen.mu
@@ -485,7 +485,18 @@ fn print-int32-decimal screen: (addr screen), n: int {
     return
   }
   # fake screen
-  # TODO
+  var s2: (stream byte 0x100)
+  var s2-addr/esi: (addr stream byte) <- address s2
+  write-int32-decimal s2-addr, n
+  var screen-addr/edi: (addr screen) <- copy screen
+  {
+    var done?/eax: boolean <- stream-empty? s2-addr
+    compare done?, 0
+    break-if-!=
+    var g/eax: grapheme <- read-grapheme s2-addr
+    print-grapheme screen, g
+    loop
+  }
 }
 
 fn reset-formatting screen: (addr screen) {