about summary refs log tree commit diff stats
path: root/subx/examples/ex4.k2
diff options
context:
space:
mode:
Diffstat (limited to 'subx/examples/ex4.k2')
-rw-r--r--subx/examples/ex4.k217
1 files changed, 0 insertions, 17 deletions
diff --git a/subx/examples/ex4.k2 b/subx/examples/ex4.k2
deleted file mode 100644
index ad968eaf..00000000
--- a/subx/examples/ex4.k2
+++ /dev/null
@@ -1,17 +0,0 @@
-# variables are always references
-#   read their address with their names: x (can't write to their address)
-#   read/write their contents with a lookup: *x
-var x : char
-
-fn main [
-  call read 0/stdin, x, 1/size  # watch out; reading a global may not be possible in all instructions
-                                # but the address is more easily obtained
-  result/EAX <- call write 1/stdout, x, 1/size
-  call exit, result/EAX
-]
-
-fn exit x : int [
-  code/EBX <- copy x
-  code/EAX <- copy 1/exit
-  syscall
-]
ADME: rewrite' href='/akspecs/ranger/commit/README?h=v1.5.5&id=e952d6cb8e67f80fcd2019abf3d30b20dc5b9f7c'>e952d6cb ^
4ad365fc ^
e952d6cb ^
c928a9eb ^
36e4e71e ^
e952d6cb ^





36e4e71e ^
4ea0f69a ^

36e4e71e ^
e952d6cb ^
36e4e71e ^

78a7d762 ^
e952d6cb ^
78a7d762 ^
e952d6cb ^
4ea0f69a ^

7838675f ^










4ea0f69a ^

36e4e71e ^
e952d6cb ^


7582555b ^
e952d6cb ^
36e4e71e ^
e952d6cb ^




36e4e71e ^
e952d6cb ^

36e4e71e ^
306c76d8 ^
e952d6cb ^

306c76d8 ^
e952d6cb ^


306c76d8 ^
e952d6cb ^
306c76d8 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^

45cf5174 ^
b34fd133 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^
45cf5174 ^
e952d6cb ^

45cf5174 ^
e952d6cb ^

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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98