From b22fa8afd813270cfb4639c8bdd9a685488af7f2 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 28 May 2020 22:41:26 -0700 Subject: 6423 - done with sample app 'print-file' Observations: - the orchestration from 'in' to 'addr-in' to '_in-addr' to 'in-addr' is quite painful. Once to turn a handle into its address, once to turn a handle into the address of its payload, and a third time to switch a variable out of the overloaded 'eax' variable to make room for read-byte-buffered. - I'm starting to use SubX as an escape hatch for features missing in Mu: - access to syscalls (which pass args in registers) - access to global variables --- apps/mu | Bin 256151 -> 256204 bytes apps/print-file.mu | 16 ++++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'apps') diff --git a/apps/mu b/apps/mu index 1f77f3b4..06f3a21b 100755 Binary files a/apps/mu and b/apps/mu differ 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 } -- cgit 1.4.1-2-gfad0 t&id=514a014df9dd5893645ca47fa8464fb64b9162cd'>commit diff stats
path: root/tools/iso/kernel.soso/tty.h
blob: df39e6cd0d081d19796cf0007c9c671c590af4fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41