about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--baremetal/shell/print.mu39
1 files changed, 39 insertions, 0 deletions
diff --git a/baremetal/shell/print.mu b/baremetal/shell/print.mu
index 9c8c719b..32f5e725 100644
--- a/baremetal/shell/print.mu
+++ b/baremetal/shell/print.mu
@@ -219,3 +219,42 @@ fn test-print-cell-singleton-list {
   print-cell list, out, 0/no-trace
   check-stream-equal out, "(abc)", "F - test-print-cell-singleton-list"
 }
+
+fn test-print-cell-list {
+  # list = cons "abc", nil
+  var left-storage: (handle cell)
+  var left/ecx: (addr handle cell) <- address left-storage
+  new-symbol left, "abc"
+  var nil-storage: (handle cell)
+  var nil/edx: (addr handle cell) <- address nil-storage
+  allocate-pair nil
+  var list-storage: (handle cell)
+  var list/esi: (addr handle cell) <- address list-storage
+  new-pair list, *left, *nil
+  # list = cons 64, list
+  new-integer left, 0x40
+  new-pair list, *left, *list
+  #
+  var out-storage: (stream byte 0x40)
+  var out/edi: (addr stream byte) <- address out-storage
+  print-cell list, out, 0/no-trace
+  check-stream-equal out, "(64 abc)", "F - test-print-cell-list"
+}
+
+fn test-print-dotted-list {
+  # list = cons 64, "abc"
+  var left-storage: (handle cell)
+  var left/ecx: (addr handle cell) <- address left-storage
+  new-symbol left, "abc"
+  var right-storage: (handle cell)
+  var right/edx: (addr handle cell) <- address right-storage
+  new-integer right, 0x40
+  var list-storage: (handle cell)
+  var list/esi: (addr handle cell) <- address list-storage
+  new-pair list, *left, *right
+  #
+  var out-storage: (stream byte 0x40)
+  var out/edi: (addr stream byte) <- address out-storage
+  print-cell list, out, 0/no-trace
+  check-stream-equal out, "(abc . 64)", "F - test-print-dotted-list"
+}
157b875e12eb7dc8cd95c1152'>^
9e751bb8 ^

e5c11a51 ^
ee67ca53 ^
4690ce81 ^
4a39d12d ^
a654e4ec ^
e5c11a51 ^
3e1349d2 ^
9e751bb8 ^

dcc060c7 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

dcc060c7 ^
e5c11a51 ^
a654e4ec ^
204dae92 ^






6c52e24e ^
204dae92 ^
9e751bb8 ^

204dae92 ^

9e751bb8 ^

204dae92 ^




6c52e24e ^
204dae92 ^
9e751bb8 ^

204dae92 ^

9e751bb8 ^

204dae92 ^




6c52e24e ^
204dae92 ^
9e751bb8 ^
204dae92 ^

9e751bb8 ^

204dae92 ^


6c52e24e ^
204dae92 ^
124c6764 ^
6c52e24e ^
204dae92 ^

6c52e24e ^
204dae92 ^




124c6764 ^
204dae92 ^


124c6764 ^

204dae92 ^



6c52e24e ^
204dae92 ^


201458e3 ^
124c6764 ^

201458e3 ^
6c52e24e ^

204dae92 ^


6c52e24e ^
204dae92 ^


6c52e24e ^
204dae92 ^


201458e3 ^
124c6764 ^

201458e3 ^
6c52e24e ^

204dae92 ^









201458e3 ^
204dae92 ^





dcc060c7 ^


a654e4ec ^
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175