interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / kernel / x86 / tools / text.om

29 lines · 493 bytes Raw Blame History
1target x86linux
2note Bytes, ASCII whitespace separated words, and newline bytes. Bounded input.
3fn run args view uchar 4096 out edit ulong 512 count ulong to ulong
4if gt count 4096
5trap 3
6end
7words = ulong 0
8lines = ulong 0
9inside = false
10for i ulong count
11c = get args i
12space = or eq c 32 and ge c 9 le c 13
13if eq c 10
14lines = add lines 1
15end
16if space
17inside = false
18else
19if not inside
20words = add words 1
21end
22inside = true
23end
24end
25put out 0 count
26put out 1 words
27put out 2 lines
28ret 24
29end