about summary refs log tree commit diff stats
path: root/405screen.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-25 21:15:43 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-25 21:15:43 -0700
commit2d7960d493c11ba6286193ec01b7f6771cd0b695 (patch)
tree023f318219fa5fe50faa891b37a4b7381cb70d91 /405screen.mu
parent1787560a6d1c3de236a40c3be457925b82a01bfd (diff)
downloadmu-2d7960d493c11ba6286193ec01b7f6771cd0b695.tar.gz
7106 - tile: arrays of ints
Diffstat (limited to '405screen.mu')
-rw-r--r--405screen.mu19
1 files changed, 19 insertions, 0 deletions
diff --git a/405screen.mu b/405screen.mu
index ba854e4a..201caba8 100644
--- a/405screen.mu
+++ b/405screen.mu
@@ -203,6 +203,25 @@ $print-string:body: {
 }
 }
 
+fn print-array-of-ints-in-decimal screen: (addr screen), _a: (addr array int) {
+  var a/esi: (addr array int) <- copy _a
+  var max/ecx: int <- length a
+  var i/eax: int <- copy 0
+  {
+    compare i, max
+    break-if->=
+    {
+      compare i, 0
+      break-if-=
+      print-string screen, " "
+    }
+    var x/ecx: (addr int) <- index a, i
+    print-int32-decimal screen, *x
+    i <- increment
+    loop
+  }
+}
+
 fn print-grapheme screen: (addr screen), c: grapheme {
 $print-grapheme:body: {
   compare screen, 0