aboutsummaryrefslogtreecommitdiff
path: root/src/Assembly/Output.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/Assembly/Output.ml')
-rw-r--r--src/Assembly/Output.ml14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Assembly/Output.ml b/src/Assembly/Output.ml
new file mode 100644
index 000000000..d84aee0a2
--- /dev/null
+++ b/src/Assembly/Output.ml
@@ -0,0 +1,14 @@
+
+open Result
+
+let list_to_string s =
+ let rec loop s n =
+ match s with
+ [] -> String.make n '?'
+ | car :: cdr ->
+ let result = loop cdr (n + 1) in
+ Bytes.set result n car;
+ result
+ in loop s 0 ;;
+
+print_string (list_to_string result) ;;