diff options
Diffstat (limited to 'apps/print-file.mu')
-rw-r--r-- | apps/print-file.mu | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/print-file.mu b/apps/print-file.mu index b5b5601b..8bec0105 100644 --- a/apps/print-file.mu +++ b/apps/print-file.mu @@ -19,13 +19,17 @@ $main-body: { var addr-in/eax: (addr handle buffered-file) <- address in open *filename, 0, addr-in } - var in-addr/eax: (addr buffered-file) <- lookup in - print-string "filename: " - print-string *filename - print-string ": " - print-int32-to-screen in-addr - print-string "\n" + var _in-addr/eax: (addr buffered-file) <- lookup in + var in-addr/ecx: (addr buffered-file) <- copy _in-addr + { + var c/eax: byte <- read-byte-buffered in-addr + compare c, 0xffffffff + break-if-= + print-byte c + loop + } } } + flush-stdout exit-status <- copy 0 } |