diff options
author | Xander <xander@biltopia.org> | 2023-07-13 00:26:49 +0200 |
---|---|---|
committer | Xander <xander@biltopia.org> | 2023-07-13 00:26:49 +0200 |
commit | e02a7e790650b31b713dde5c39ad6172c048f571 (patch) | |
tree | e06f29fbff44f9dcb44dc4c0c30dd58484069785 /kernel/output | |
parent | f44cb1fd2e58f0233dccdf8a1fac84e310857e7e (diff) | |
download | ats-os-e02a7e790650b31b713dde5c39ad6172c048f571.tar.xz ats-os-e02a7e790650b31b713dde5c39ad6172c048f571.zip |
int to string conversion implementation
Diffstat (limited to 'kernel/output')
-rw-r--r-- | kernel/output/print.dats | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/output/print.dats b/kernel/output/print.dats index 22fe575..9b5def0 100644 --- a/kernel/output/print.dats +++ b/kernel/output/print.dats @@ -2,14 +2,20 @@ #define ATS_DYNLOADFLAG 0 + staload "kernel/output/writer.sats" +staload "kernel/itoa.dats" extern fun print_newline() : void -implement print_newline() : void = put_string("\n") +implement print_newline() = put_string("\n") extern fun assert_errmsg(b: bool, msg: string) : void -implement assert_errmsg(b: bool, msg: string) : void = put_string(msg) +implement assert_errmsg(b,msg) = if (~b) then put_string(msg) +extern fun print_int {n : nat | n > 0} (n : int n) : void +implement print_int(n) = put_string(itoa(n,10)) + overload print with put_string of 1 +overload print with print_int of 1 macdef assertloc(tf) = assert_errmsg (,(tf), $mylocation) |