aboutsummaryrefslogtreecommitdiff
path: root/kernel/prelude/DATS/print.dats
diff options
context:
space:
mode:
authorXander <xander@biltopia.org>2023-07-15 00:31:51 +0200
committerXander <xander@biltopia.org>2023-07-15 00:31:51 +0200
commitab383485291164f7bc78b88787271dd1b85c0d73 (patch)
tree2c94f258cda82214bf1834a56571d3b8487f652c /kernel/prelude/DATS/print.dats
parent5ad68a0c087d21fa1d0f82bea1550169f1e4c1aa (diff)
downloadats-os-ab383485291164f7bc78b88787271dd1b85c0d73.tar.xz
ats-os-ab383485291164f7bc78b88787271dd1b85c0d73.zip
Boot info memory mapping implementation
Diffstat (limited to 'kernel/prelude/DATS/print.dats')
-rw-r--r--kernel/prelude/DATS/print.dats12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/prelude/DATS/print.dats b/kernel/prelude/DATS/print.dats
index 0b5c38a..c6cd220 100644
--- a/kernel/prelude/DATS/print.dats
+++ b/kernel/prelude/DATS/print.dats
@@ -28,15 +28,27 @@ implement print_uint8 (n) = put_string(itoa($UN.cast{int}(n),10))
extern fun print_uint64 (n : uint64) : void
implement print_uint64 (n) = put_string(itoa($UN.cast{int}(n),10))
+extern fun print_size_t (n : size_t) : void
+implement print_size_t (n) = put_string(itoa($UN.cast{int}(n),10))
+
+extern fun print_uint (n : uint) : void
+implement print_uint (n) = put_string(itoa($UN.cast{int}(n),10))
+
overload print with put_string of 1
overload print with print_int of 1
overload print with print_uint32 of 1
overload print with print_uint64 of 1
overload print with print_uint16 of 1
overload print with print_uint8 of 1
+overload print with print_size_t of 1
+overload print with print_uint of 1
extern fun {a : t@ype} println_base {n:nat | n > 1 && n < 33} (n :a, base : int n) : void
implement{a} println_base(n,base) = println!(itoa($UN.cast{int}(n), base))
+extern fun {a : t@ype} print_base {n:nat | n > 1 && n < 33} (n :a, base : int n) : void
+implement{a} print_base(n,base) = put_string(itoa($UN.cast{int}(n), base))
+
macdef println_hex(s) = (put_string "0x"; println_base(,(s), 16))
+macdef print_hex(s) = (put_string "0x"; print_base(,(s), 16))
macdef assertloc(tf) = assert_errmsg (,(tf), $mylocation)