https://github.com/akkartik/mu/blob/master/subx/065hex.subx
1
2
3
4 == code
5
6
7
8
9 is-hex-int?:
10
11 55/push-EBP
12 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
13
14 51/push-ECX
15 52/push-EDX
16 53/push-EBX
17
18 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 8/disp8 .
19
20 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 2/r32/EDX 4/disp8 .
21
22 8b/copy 0/mod/indirect 1/rm32/ECX . . . 1/r32/ECX . .
23
24 b8/copy-to-EAX 0/imm32/false
25 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
26 73/jump-if-greater-or-equal-unsigned $is-hex-int?:end/disp8
27
28
29 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
30 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 3/r32/BL . .
31 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0x2d/imm32/-
32 75/jump-if-not-equal $is-hex-int?:initial-0/disp8
33
34 41/increment-ECX
35
36 $is-hex-int?:initial-0:
37
38 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
39 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 3/r32/BL . .
40 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0x30/imm32/0
41 75/jump-if-not-equal $is-hex-int?:loop/disp8
42
43 41/increment-ECX
44 $is-hex-int?:initial-0x:
45
46 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
47 73/jump-if-greater-or-equal-unsigned $is-hex-int?:true/disp8
48
49 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
50 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 3/r32/BL . .
51 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0x78/imm32/x
52 75/jump-if-not-equal $is-hex-int?:loop/disp8
53
54 41/increment-ECX
55 $is-hex-int?:loop:
56
57 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
58 73/jump-if-greater-or-equal-unsigned $is-hex-int?:true/disp8
59
60
61 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
62 50/push-EAX
63
64 e8/call is-hex-digit?/disp32
65
66 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
67
68 3d/compare-EAX-and 0/imm32
69 74/jump-if-equal $is-hex-int?:end/disp8
70
71 41/increment-ECX
72
73 eb/jump $is-hex-int?:loop/disp8
74 $is-hex-int?:true:
75
76 b8/copy-to-EAX 1/imm32/true
77 $is-hex-int?:end:
78
79 5b/pop-to-EBX
80 5a/pop-to-EDX
81 59/pop-to-ECX
82
83 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
84 5d/pop-to-EBP
85 c3/return
86
87 test-is-hex-int:
88
89 55/push-EBP
90 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
91
92 b8/copy-to-EAX "34"/imm32
93 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
94 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
95 05/add-to-EAX 4/imm32
96
97 51/push-ECX
98 50/push-EAX
99 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
100
101
102 51/push-ECX
103
104 e8/call is-hex-int?/disp32
105
106 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
107
108
109 68/push "F - test-is-hex-int"/imm32
110 68/push 1/imm32/true
111 50/push-EAX
112
113 e8/call check-ints-equal/disp32
114
115 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
116
117 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
118 5d/pop-to-EBP
119 c3/return
120
121 test-is-hex-int-handles-letters:
122
123 55/push-EBP
124 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
125
126 b8/copy-to-EAX "34a"/imm32
127 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
128 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
129 05/add-to-EAX 4/imm32
130
131 51/push-ECX
132 50/push-EAX
133 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
134
135
136 51/push-ECX
137
138 e8/call is-hex-int?/disp32
139
140 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
141
142
143 68/push "F - test-is-hex-int-handles-letters"/imm32
144 68/push 1/imm32/true
145 50/push-EAX
146
147 e8/call check-ints-equal/disp32
148
149 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
150
151 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
152 5d/pop-to-EBP
153 c3/return
154
155 test-is-hex-int-with-trailing-char:
156
157 55/push-EBP
158 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
159
160 b8/copy-to-EAX "34q"/imm32
161 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
162 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
163 05/add-to-EAX 4/imm32
164
165 51/push-ECX
166 50/push-EAX
167 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
168
169
170 51/push-ECX
171
172 e8/call is-hex-int?/disp32
173
174 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
175
176
177 68/push "F - test-is-hex-int-with-trailing-char"/imm32
178 68/push 0/imm32/false
179 50/push-EAX
180
181 e8/call check-ints-equal/disp32
182
183 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
184
185 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
186 5d/pop-to-EBP
187 c3/return
188
189 test-is-hex-int-with-leading-char:
190
191 55/push-EBP
192 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
193
194 b8/copy-to-EAX "q34"/imm32
195 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
196 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
197 05/add-to-EAX 4/imm32
198
199 51/push-ECX
200 50/push-EAX
201 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
202
203
204 51/push-ECX
205
206 e8/call is-hex-int?/disp32
207
208 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
209
210
211 68/push "F - test-is-hex-int-with-leading-char"/imm32
212 68/push 0/imm32/false
213 50/push-EAX
214
215 e8/call check-ints-equal/disp32
216
217 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
218
219 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
220 5d/pop-to-EBP
221 c3/return
222
223 test-is-hex-int-empty:
224
225 55/push-EBP
226 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
227
228 68/push 0/imm32
229 68/push 0/imm32
230 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
231
232
233 51/push-ECX
234
235 e8/call is-hex-int?/disp32
236
237 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
238
239
240 68/push "F - test-is-hex-int-empty"/imm32
241 68/push 0/imm32/false
242 50/push-EAX
243
244 e8/call check-ints-equal/disp32
245
246 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
247
248 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
249 5d/pop-to-EBP
250 c3/return
251
252 test-is-hex-int-handles-0x-prefix:
253
254 55/push-EBP
255 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
256
257 b8/copy-to-EAX "0x3a"/imm32
258 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
259 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
260 05/add-to-EAX 4/imm32
261
262 51/push-ECX
263 50/push-EAX
264 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
265
266
267 51/push-ECX
268
269 e8/call is-hex-int?/disp32
270
271 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
272
273
274 68/push "F - test-is-hex-int-handles-0x-prefix"/imm32
275 68/push 1/imm32/true
276 50/push-EAX
277
278 e8/call check-ints-equal/disp32
279
280 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
281
282 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
283 5d/pop-to-EBP
284 c3/return
285
286 test-is-hex-int-handles-negative:
287
288 55/push-EBP
289 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
290
291 b8/copy-to-EAX "-34a"/imm32
292 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
293 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
294 05/add-to-EAX 4/imm32
295
296 51/push-ECX
297 50/push-EAX
298 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
299
300
301 51/push-ECX
302
303 e8/call is-hex-int?/disp32
304
305 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
306
307
308 68/push "F - test-is-hex-int-handles-negative"/imm32
309 68/push 1/imm32/true
310 50/push-EAX
311
312 e8/call check-ints-equal/disp32
313
314 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
315
316 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
317 5d/pop-to-EBP
318 c3/return
319
320 test-is-hex-int-handles-negative-0x-prefix:
321
322 55/push-EBP
323 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
324
325 b8/copy-to-EAX "-0x3a"/imm32
326 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
327 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
328 05/add-to-EAX 4/imm32
329
330 51/push-ECX
331 50/push-EAX
332 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
333
334
335 51/push-ECX
336
337 e8/call is-hex-int?/disp32
338
339 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
340
341
342 68/push "F - test-is-hex-int-handles-negative-0x-prefix"/imm32
343 68/push 1/imm32/true
344 50/push-EAX
345
346 e8/call check-ints-equal/disp32
347
348 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
349
350 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
351 5d/pop-to-EBP
352 c3/return
353
354 parse-hex-int:
355
356 55/push-EBP
357 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
358
359 51/push-ECX
360 52/push-EDX
361 53/push-EBX
362 56/push-ESI
363
364 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
365
366 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 8/disp8 .
367
368 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 2/r32/EDX 4/disp8 .
369
370 8b/copy 0/mod/indirect 1/rm32/ECX . . . 1/r32/ECX . .
371
372 31/xor 3/mod/direct 6/rm32/ESI . . . 6/r32/ESI . .
373 $parse-hex-int:negative:
374
375 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
376 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
377 3d/compare-EAX-and 0x2d/imm32/-
378 75/jump-if-not-equal $parse-hex-int:initial-0/disp8
379
380 41/increment-ECX
381
382 be/copy-to-ESI 1/imm32/true
383 $parse-hex-int:initial-0:
384
385
386 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
387 3d/compare-EAX-and 0x30/imm32/0
388 75/jump-if-not-equal $parse-hex-int:loop/disp8
389
390 41/increment-ECX
391 $parse-hex-int:initial-0x:
392
393 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
394 73/jump-if-greater-or-equal-unsigned $parse-hex-int:end/disp8
395
396 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
397 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
398 3d/compare-EAX-and 0x78/imm32/x
399 75/jump-if-not-equal $parse-hex-int:loop/disp8
400
401 41/increment-ECX
402 $parse-hex-int:loop:
403
404 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
405 73/jump-if-greater-or-equal-unsigned $parse-hex-int:negate/disp8
406
407
408 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
409
410 e8/call from-hex-char/disp32
411
412 c1/shift 4/subop/left 3/mod/direct 3/rm32/EBX . . . . . 4/imm8
413 01/add 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
414
415 41/increment-ECX
416
417 eb/jump $parse-hex-int:loop/disp8
418 $parse-hex-int:negate:
419 81 7/subop/compare 3/mod/direct 6/rm32/ESI . . . . . 0/imm32
420 74/jump-if-equal $parse-hex-int:end/disp8
421 f7 3/subop/negate 3/mod/direct 3/rm32/EBX . . . . . .
422 $parse-hex-int:end:
423 89/copy 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . .
424
425 5e/pop-to-ESI
426 5b/pop-to-EBX
427 5a/pop-to-EDX
428 59/pop-to-ECX
429
430 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
431 5d/pop-to-EBP
432 c3/return
433
434 test-parse-hex-int-single-digit:
435
436 55/push-EBP
437 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
438
439 b8/copy-to-EAX "a"/imm32
440 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
441 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
442 05/add-to-EAX 4/imm32
443
444 51/push-ECX
445 50/push-EAX
446 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
447
448
449 51/push-ECX
450
451 e8/call parse-hex-int/disp32
452
453 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
454
455
456 68/push "F - test-parse-hex-int-single-digit"/imm32
457 68/push 0xa/imm32
458 50/push-EAX
459
460 e8/call check-ints-equal/disp32
461
462 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
463
464 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
465 5d/pop-to-EBP
466 c3/return
467
468 test-parse-hex-int-multi-digit:
469
470 55/push-EBP
471 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
472
473 b8/copy-to-EAX "34a"/imm32
474 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
475 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
476 05/add-to-EAX 4/imm32
477
478 51/push-ECX
479 50/push-EAX
480 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
481
482
483 51/push-ECX
484
485 e8/call parse-hex-int/disp32
486
487 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
488
489
490 68/push "F - test-parse-hex-int-multi-digit"/imm32
491 68/push 0x34a/imm32
492 50/push-EAX
493
494 e8/call check-ints-equal/disp32
495
496 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
497
498 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
499 5d/pop-to-EBP
500 c3/return
501
502 test-parse-hex-int-0x-prefix:
503
504 55/push-EBP
505 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
506
507 b8/copy-to-EAX "0x34"/imm32
508 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
509 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
510 05/add-to-EAX 4/imm32
511
512 51/push-ECX
513 50/push-EAX
514 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
515
516
517 51/push-ECX
518
519 e8/call parse-hex-int/disp32
520
521 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
522
523
524 68/push "F - test-parse-hex-int-0x-prefix"/imm32
525 68/push 0x34/imm32
526 50/push-EAX
527
528 e8/call check-ints-equal/disp32
529
530 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
531
532 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
533 5d/pop-to-EBP
534 c3/return
535
536 test-parse-hex-int-zero:
537
538 55/push-EBP
539 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
540
541 b8/copy-to-EAX "0"/imm32
542 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
543 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
544 05/add-to-EAX 4/imm32
545
546 51/push-ECX
547 50/push-EAX
548 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
549
550
551 51/push-ECX
552
553 e8/call parse-hex-int/disp32
554
555 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
556
557
558 68/push "F - test-parse-hex-int-zero"/imm32
559 68/push 0/imm32
560 50/push-EAX
561
562 e8/call check-ints-equal/disp32
563
564 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
565
566 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
567 5d/pop-to-EBP
568 c3/return
569
570 test-parse-hex-int-0-prefix:
571
572 55/push-EBP
573 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
574
575 b8/copy-to-EAX "03"/imm32
576 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
577 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
578 05/add-to-EAX 4/imm32
579
580 51/push-ECX
581 50/push-EAX
582 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
583
584
585 51/push-ECX
586
587 e8/call parse-hex-int/disp32
588
589 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
590
591
592 68/push "F - test-parse-hex-int-0-prefix"/imm32
593 68/push 0x3/imm32
594 50/push-EAX
595
596 e8/call check-ints-equal/disp32
597
598 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
599
600 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
601 5d/pop-to-EBP
602 c3/return
603
604 test-parse-hex-int-negative:
605
606 55/push-EBP
607 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
608
609 b8/copy-to-EAX "-03"/imm32
610 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
611 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
612 05/add-to-EAX 4/imm32
613
614 51/push-ECX
615 50/push-EAX
616 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
617
618
619 51/push-ECX
620
621 e8/call parse-hex-int/disp32
622
623 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
624
625
626 68/push "F - test-parse-hex-int-negative"/imm32
627 68/push 0xfffffffd/imm32
628 50/push-EAX
629
630 e8/call check-ints-equal/disp32
631
632 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
633
634 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
635 5d/pop-to-EBP
636 c3/return
637
638 is-hex-digit?:
639
640 55/push-EBP
641 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
642
643 51/push-ECX
644
645 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 8/disp8 .
646
647 b8/copy-to-EAX 0/imm32/false
648 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x30/imm32
649 7c/jump-if-lesser $is-hex-digit?:end/disp8
650
651 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x66/imm32
652 7f/jump-if-greater $is-hex-digit?:end/disp8
653
654 b8/copy-to-EAX 1/imm32/true
655 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x39/imm32
656 7e/jump-if-lesser-or-equal $is-hex-digit?:end/disp8
657
658 81 7/subop/compare 3/mod/direct 1/rm32/ECX . . . . . 0x61/imm32
659 7d/jump-if-greater-or-equal $is-hex-digit?:end/disp8
660
661 b8/copy-to-EAX 0/imm32/false
662 $is-hex-digit?:end:
663
664 59/pop-to-ECX
665
666 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
667 5d/pop-to-EBP
668 c3/return
669
670 test-hex-below-0:
671
672
673 68/push 0x2f/imm32
674
675 e8/call is-hex-digit?/disp32
676
677 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
678
679
680 68/push "F - test-hex-below-0"/imm32
681 68/push 0/imm32/false
682 50/push-EAX
683
684 e8/call check-ints-equal/disp32
685
686 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
687 c3/return
688
689 test-hex-0-to-9:
690
691
692 68/push 0x30/imm32
693
694 e8/call is-hex-digit?/disp32
695
696 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
697
698
699 68/push "F - test-hex-at-0"/imm32
700 68/push 1/imm32/true
701 50/push-EAX
702
703 e8/call check-ints-equal/disp32
704
705 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
706
707
708 68/push 0x39/imm32
709
710 e8/call is-hex-digit?/disp32
711
712 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
713
714
715 68/push "F - test-hex-at-9"/imm32
716 68/push 1/imm32/true
717 50/push-EAX
718
719 e8/call check-ints-equal/disp32
720
721 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
722 c3/return
723
724 test-hex-above-9-to-a:
725
726
727 68/push 0x3a/imm32
728
729 e8/call is-hex-digit?/disp32
730
731 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
732
733
734 68/push "F - test-hex-above-9-to-a"/imm32
735 68/push 0/imm32/false
736 50/push-EAX
737
738 e8/call check-ints-equal/disp32
739
740 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
741 c3/return
742
743 test-hex-a-to-f:
744
745
746 68/push 0x61/imm32
747
748 e8/call is-hex-digit?/disp32
749
750 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
751
752
753 68/push "F - test-hex-at-a"/imm32
754 68/push 1/imm32/true
755 50/push-EAX
756
757 e8/call check-ints-equal/disp32
758
759 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
760
761
762 68/push 0x66/imm32
763
764 e8/call is-hex-digit?/disp32
765
766 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
767
768
769 68/push "F - test-hex-at-f"/imm32
770 68/push 1/imm32/true
771 50/push-EAX
772
773 e8/call check-ints-equal/disp32
774
775 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
776 c3/return
777
778 test-hex-above-f:
779
780
781 68/push 0x67/imm32
782
783 e8/call is-hex-digit?/disp32
784
785 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
786
787
788 68/push "F - test-hex-above-f"/imm32
789 68/push 0/imm32/false
790 50/push-EAX
791
792 e8/call check-ints-equal/disp32
793
794 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
795 c3/return
796
797 from-hex-char:
798
799
800 3d/compare-EAX-with 0x39/imm32/9
801 7f/jump-if-greater $from-hex-char:else/disp8
802 2d/subtract-from-EAX 0x30/imm32/0
803 c3/return
804 $from-hex-char:else:
805
806 2d/subtract-from-EAX 0x57/imm32/a-10
807 c3/return
808
809 to-hex-char:
810
811
812 3d/compare-EAX-with 0x9/imm32/9
813 7f/jump-if-greater $to-hex-char:else/disp8
814 05/add-to-EAX 0x30/imm32/0
815 c3/return
816 $to-hex-char:else:
817
818 05/add-to-EAX 0x57/imm32/a-10
819 c3/return
820
821