about summary refs log tree commit diff stats
path: root/linux/crenshaw2-1b.subx
diff options
context:
space:
mode:
Diffstat (limited to 'linux/crenshaw2-1b.subx')
-rw-r--r--linux/crenshaw2-1b.subx24
1 files changed, 12 insertions, 12 deletions
diff --git a/linux/crenshaw2-1b.subx b/linux/crenshaw2-1b.subx
index fb8fd3b4..6915bd01 100644
--- a/linux/crenshaw2-1b.subx
+++ b/linux/crenshaw2-1b.subx
@@ -186,7 +186,7 @@ $compile:end:
 # 'in' (rest). We leave the next byte from 'in' into 'Look' on exit.
 get-num:  # in: (addr buffered-file), out: (addr stream byte), err: fd or (addr stream byte), ed: (addr exit-descriptor)
     # pseudocode:
-    #   if (!is-digit?(Look)) expected(ed, err, "integer")
+    #   if (!digit?(Look)) expected(ed, err, "integer")
     #   do
     #     if out->write >= out->size
     #       write(err, "Error: too many digits in number\n")
@@ -194,7 +194,7 @@ get-num:  # in: (addr buffered-file), out: (addr stream byte), err: fd or (addr
     #     out->data[out->write] = LSB(Look)
     #     ++out->write
     #     Look = get-char(in)
-    #   while is-digit?(Look)
+    #   while digit?(Look)
     # This is complicated because I don't want to hard-code the error strategy in
     # a general helper like write-byte-buffered. Maybe I should just create a
     # local helper.
@@ -212,12 +212,12 @@ get-num:  # in: (addr buffered-file), out: (addr stream byte), err: fd or (addr
     # . prologue
     55/push-ebp
     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
-    # - if (is-digit?(Look)) expected(ed, err, "integer")
-    # . eax = is-digit?(Look)
+    # - if (digit?(Look)) expected(ed, err, "integer")
+    # . eax = digit?(Look)
     # . . push args
     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Look/disp32     .                 # push *Look
     # . . call
-    e8/call  is-digit?/disp32
+    e8/call  digit?/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . if (eax == false)
@@ -277,12 +277,12 @@ $get-num:loop-stage2:
     e8/call  get-char/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-    # if (is-digit?(Look)) loop
-    # . eax = is-digit?(Look)
+    # if (digit?(Look)) loop
+    # . eax = digit?(Look)
     # . . push args
     ff          6/subop/push        0/mod/indirect  5/rm32/.disp32            .             .           .           Look/disp32     .                 # push *Look
     # . . call
-    e8/call  is-digit?/disp32
+    e8/call  digit?/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
     # . if (eax != false) loop
@@ -722,7 +722,7 @@ $get-char:end:
     5d/pop-to-ebp
     c3/return
 
-is-digit?:  # c: int -> eax: boolean
+digit?:  # c: int -> eax: boolean
     # . prologue
     55/push-ebp
     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -730,13 +730,13 @@ is-digit?:  # c: int -> eax: boolean
     b8/copy-to-eax  0/imm32
     # if (c < '0') return false
     81          7/subop/compare     1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         0x30/imm32        # compare *(ebp+8)
-    7c/jump-if-<  $is-digit?:end/disp8
+    7c/jump-if-<  $digit?:end/disp8
     # if (c > '9') return false
     81          7/subop/compare     1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         0x39/imm32        # compare *(ebp+8)
-    7f/jump-if->  $is-digit?:end/disp8
+    7f/jump-if->  $digit?:end/disp8
     # otherwise return true
     b8/copy-to-eax  1/imm32
-$is-digit?:end:
+$digit?:end:
     # . epilogue
     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
     5d/pop-to-ebp
<vc@akkartik.com> 2015-07-15 18:05:28 -0700 1787 - clear warnings between runs' href='/akkartik/mu/commit/081run_interactive.cc?h=main&id=d6c9fe6305ed9775c5ad814dee45e405da3fbecd'>d6c9fe63 ^
6dc1379b ^
b17c196d ^



87fbfc2d ^

9fdda88b ^

32cd40ec ^
9fdda88b ^

32cd40ec ^
87fbfc2d ^
2c3afb53 ^

6dc1379b ^

363be37f ^

32cd40ec ^
a2a6e35e ^
2c3afb53 ^







32cd40ec ^


de92036d ^
b17c196d ^
363be37f ^
260c3de2 ^
f43c2125 ^


09454849 ^
f43c2125 ^
87fbfc2d ^
32cd40ec ^





87fbfc2d ^
d6c9fe63 ^
9fdda88b ^
363be37f ^
b17c196d ^
87fbfc2d ^
12c3ee1e ^
9fdda88b ^









76d22198 ^














0685569c ^












9fdda88b ^

90938fcb ^

9fdda88b ^
76d22198 ^
90938fcb ^

9fdda88b ^



76d22198 ^

76d22198 ^
76d22198 ^
de92036d ^
76d22198 ^



d6c9fe63 ^

9fdda88b ^

9fdda88b ^



32cd40ec ^
9fdda88b ^


de92036d ^
9fdda88b ^
32cd40ec ^
0685569c ^



32cd40ec ^

a2a6e35e ^
32cd40ec ^








32cd40ec ^

32cd40ec ^





4efc0ff3 ^
32cd40ec ^






a2a6e35e ^
32cd40ec ^

2e8c5d39 ^

9fdda88b ^
be13beeb ^

be13beeb ^









be13beeb ^


de92036d ^
76d22198 ^









b17c196d ^
548cd00a ^

b17c196d ^
de92036d ^
548cd00a ^

76d22198 ^






0685569c ^









de92036d ^
0685569c ^
f0eb3556 ^









4efc0ff3 ^




f0eb3556 ^
7e423e26 ^
de92036d ^
f0eb3556 ^
4efc0ff3 ^
7e423e26 ^
f0eb3556 ^


4efc0ff3 ^



f0eb3556 ^

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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286