https://github.com/akkartik/mu/blob/master/subx/072slice.subx
1
2
3
4 == code
5
6
7
8
9
10
11
12
13
14
15
16 slice-empty?:
17
18 55/push-EBP
19 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
20
21 51/push-ECX
22
23 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 1/r32/ECX 8/disp8 .
24
25
26 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
27
28 39/compare 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
29 b8/copy-to-EAX 1/imm32/true
30 74/jump-if-equal $slice-empty?:end/disp8
31 b8/copy-to-EAX 0/imm32/false
32 $slice-empty?:end:
33
34 59/pop-to-ECX
35
36 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
37 5d/pop-to-EBP
38 c3/return
39
40 test-slice-empty-true:
41
42 55/push-EBP
43 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
44
45 68/push 34/imm32/end
46 68/push 34/imm32/start
47 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
48
49
50 51/push-ECX
51
52 e8/call slice-empty?/disp32
53
54 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
55
56
57 68/push "F - test-slice-empty-true"/imm32
58 68/push 1/imm32
59 50/push-EAX
60
61 e8/call check-ints-equal/disp32
62
63 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
64
65 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
66 5d/pop-to-EBP
67 c3/return
68
69 test-slice-empty-false:
70
71 55/push-EBP
72 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
73
74 68/push 23/imm32/end
75 68/push 34/imm32/start
76 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
77
78
79 51/push-ECX
80
81 e8/call slice-empty?/disp32
82
83 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
84
85
86 68/push "F - test-slice-empty-false"/imm32
87 68/push 0/imm32
88 50/push-EAX
89
90 e8/call check-ints-equal/disp32
91
92 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
93
94 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
95 5d/pop-to-EBP
96 c3/return
97
98 slice-equal?:
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119 55/push-EBP
120 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
121
122 51/push-ECX
123 52/push-EDX
124 53/push-EBX
125 56/push-ESI
126
127 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
128
129 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . .
130
131 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 6/r32/ESI 4/disp8 .
132
133 89/copy 3/mod/direct 0/rm32/EAX . . . 6/r32/ESI . .
134 29/subtract 3/mod/direct 0/rm32/EAX . . . 2/r32/EDX . .
135
136 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 3/r32/EBX 0xc/disp8 .
137
138 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0/imm32
139 75/jump-if-not-equal $slice-equal?:nonnull-string/disp8
140 $slice-equal?:null-string:
141
142 3d/compare-EAX-and 0/imm32
143 74/jump-if-equal $slice-equal?:true/disp8
144 eb/jump $slice-equal?:false/disp8
145 $slice-equal?:nonnull-string:
146
147 39/compare 0/mod/indirect 3/rm32/EBX . . . 0/r32/EAX . .
148 75/jump-if-not-equal $slice-equal?:false/disp8
149
150 81 0/subop/add 3/mod/direct 3/rm32/EBX . . . . . 4/imm32
151
152 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
153 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . .
154 $slice-equal?:loop:
155
156 39/compare 3/mod/direct 2/rm32/EDX . . . 6/r32/ESI . .
157 7d/jump-if-greater-or-equal $slice-equal?:true/disp8
158
159 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
160
161 8a/copy-byte 0/mod/indirect 2/rm32/EDX . . . 1/r32/CL . .
162
163 39/compare 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
164 75/jump-if-not-equal $slice-equal?:false/disp8
165
166 43/increment-EBX
167
168 42/increment-EDX
169 eb/jump $slice-equal?:loop/disp8
170 $slice-equal?:false:
171 b8/copy-to-EAX 0/imm32
172 eb/jump $slice-equal?:end/disp8
173 $slice-equal?:true:
174 b8/copy-to-EAX 1/imm32
175 $slice-equal?:end:
176
177 5e/pop-to-ESI
178 5b/pop-to-EBX
179 5a/pop-to-EDX
180 59/pop-to-ECX
181
182 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
183 5d/pop-to-EBP
184 c3/return
185
186 test-slice-equal:
187
188
189 55/push-EBP
190 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
191
192 68/push _test-slice-data-3/imm32/end
193 68/push _test-slice-data-0/imm32/start
194 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
195
196
197 68/push "Abc"/imm32
198 51/push-ECX
199
200 e8/call slice-equal?/disp32
201
202 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
203
204
205 68/push "F - test-slice-equal"/imm32
206 68/push 1/imm32
207 50/push-EAX
208
209 e8/call check-ints-equal/disp32
210
211 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
212
213 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
214 5d/pop-to-EBP
215 c3/return
216
217 test-slice-equal-false:
218
219
220 55/push-EBP
221 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
222
223 68/push _test-slice-data-4/imm32/end
224 68/push _test-slice-data-1/imm32/start
225 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
226
227
228 68/push "Abc"/imm32
229 51/push-ECX
230
231 e8/call slice-equal?/disp32
232
233 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
234
235
236 68/push "F - test-slice-equal-false"/imm32
237 68/push 0/imm32
238 50/push-EAX
239
240 e8/call check-ints-equal/disp32
241
242 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
243
244 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
245 5d/pop-to-EBP
246 c3/return
247
248 test-slice-equal-too-long:
249
250
251 55/push-EBP
252 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
253
254 68/push _test-slice-data-4/imm32/end
255 68/push _test-slice-data-0/imm32/start
256 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
257
258
259 68/push "Abc"/imm32
260 51/push-ECX
261
262 e8/call slice-equal?/disp32
263
264 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
265
266
267 68/push "F - test-slice-equal-too-long"/imm32
268 68/push 0/imm32
269 50/push-EAX
270
271 e8/call check-ints-equal/disp32
272
273 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
274
275 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
276 5d/pop-to-EBP
277 c3/return
278
279 test-slice-equal-too-short:
280
281
282 55/push-EBP
283 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
284
285 68/push _test-slice-data-1/imm32/end
286 68/push _test-slice-data-0/imm32/start
287 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
288
289
290 68/push "Abc"/imm32
291 51/push-ECX
292
293 e8/call slice-equal?/disp32
294
295 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
296
297
298 68/push "F - test-slice-equal-too-short"/imm32
299 68/push 0/imm32
300 50/push-EAX
301
302 e8/call check-ints-equal/disp32
303
304 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
305
306 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
307 5d/pop-to-EBP
308 c3/return
309
310 test-slice-equal-empty:
311
312
313 55/push-EBP
314 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
315
316 68/push _test-slice-data-0/imm32/end
317 68/push _test-slice-data-0/imm32/start
318 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
319
320
321 68/push "Abc"/imm32
322 51/push-ECX
323
324 e8/call slice-equal?/disp32
325
326 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
327
328
329 68/push "F - test-slice-equal-empty"/imm32
330 68/push 0/imm32
331 50/push-EAX
332
333 e8/call check-ints-equal/disp32
334
335 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
336
337 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
338 5d/pop-to-EBP
339 c3/return
340
341 test-slice-equal-with-empty:
342
343
344 55/push-EBP
345 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
346
347 68/push _test-slice-data-2/imm32/end
348 68/push _test-slice-data-0/imm32/start
349 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
350
351
352 68/push ""/imm32
353 51/push-ECX
354
355 e8/call slice-equal?/disp32
356
357 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
358
359
360 68/push "F - test-slice-equal-with-empty"/imm32
361 68/push 0/imm32
362 50/push-EAX
363
364 e8/call check-ints-equal/disp32
365
366 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
367
368 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
369 5d/pop-to-EBP
370 c3/return
371
372 test-slice-equal-empty-with-empty:
373
374
375 55/push-EBP
376 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
377
378 68/push _test-slice-data-0/imm32/end
379 68/push _test-slice-data-0/imm32/start
380 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
381
382
383 68/push ""/imm32
384 51/push-ECX
385
386 e8/call slice-equal?/disp32
387
388 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
389
390
391 68/push "F - test-slice-equal-empty-with-empty"/imm32
392 68/push 1/imm32
393 50/push-EAX
394
395 e8/call check-ints-equal/disp32
396
397 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
398
399 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
400 5d/pop-to-EBP
401 c3/return
402
403 test-slice-equal-with-null:
404
405
406 55/push-EBP
407 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
408
409 68/push _test-slice-data-2/imm32/end
410 68/push _test-slice-data-0/imm32/start
411 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
412
413
414 68/push 0/imm32
415 51/push-ECX
416
417 e8/call slice-equal?/disp32
418
419 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
420
421
422 68/push "F - test-slice-equal-with-null"/imm32
423 68/push 0/imm32
424 50/push-EAX
425
426 e8/call check-ints-equal/disp32
427
428 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
429
430 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
431 5d/pop-to-EBP
432 c3/return
433
434 slice-starts-with?:
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457 55/push-EBP
458 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
459
460 51/push-ECX
461 52/push-EDX
462 53/push-EBX
463 56/push-ESI
464 57/push-EDI
465
466 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
467
468 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
469 2b/subtract 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
470
471 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 .
472
473 8b/copy 0/mod/indirect 7/rm32/EDI . . . 2/r32/EDX . .
474
475 39/compare 3/mod/direct 2/rm32/EDX . . . 1/r32/ECX . .
476 7f/jump-if-greater $slice-starts-with?:false/disp8
477
478 8b/subtract 0/mod/indirect 6/rm32/ESI . . . 6/r32/ESI . .
479
480 81 0/subop/add 3/mod/direct 7/rm32/EDI . . . . . 4/imm32
481
482 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . .
483
484 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
485 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
486 $slice-starts-with?:loop:
487
488 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
489 7d/jump-if-greater-or-equal $slice-starts-with?:true/disp8
490
491 8a/copy-byte 0/mod/indirect 6/rm32/ESI . . . 0/r32/AL . .
492
493 8a/copy-byte 0/mod/indirect 7/rm32/EDI . . . 3/r32/BL . .
494
495 39/compare 3/mod/direct 0/rm32/EAX . . . 3/r32/EBX . .
496 75/jump-if-not-equal $slice-starts-with?:false/disp8
497
498 41/increment-ECX
499
500 46/increment-ESI
501
502 47/increment-EDI
503 eb/jump $slice-starts-with?:loop/disp8
504 $slice-starts-with?:true:
505 b8/copy-to-EAX 1/imm32
506 eb/jump $slice-starts-with?:end/disp8
507 $slice-starts-with?:false:
508 b8/copy-to-EAX 0/imm32
509 $slice-starts-with?:end:
510
511 5f/pop-to-EDI
512 5e/pop-to-ESI
513 5b/pop-to-EBX
514 5a/pop-to-EDX
515 59/pop-to-ECX
516
517 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
518 5d/pop-to-EBP
519 c3/return
520
521 test-slice-starts-with-single-character:
522
523
524 55/push-EBP
525 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
526
527 68/push _test-slice-data-3/imm32/end
528 68/push _test-slice-data-0/imm32/start
529 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
530
531
532 68/push "A"/imm32
533 51/push-ECX
534
535 e8/call slice-starts-with?/disp32
536
537 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
538
539
540 68/push "F - test-slice-starts-with-single-character"/imm32
541 68/push 1/imm32
542 50/push-EAX
543
544 e8/call check-ints-equal/disp32
545
546 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
547
548 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
549 5d/pop-to-EBP
550 c3/return
551
552 test-slice-starts-with-empty-string:
553
554
555 55/push-EBP
556 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
557
558 68/push _test-slice-data-3/imm32/end
559 68/push _test-slice-data-0/imm32/start
560 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
561
562
563 68/push ""/imm32
564 51/push-ECX
565
566 e8/call slice-starts-with?/disp32
567
568 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
569
570
571 68/push "F - test-slice-starts-with-empty-string"/imm32
572 68/push 1/imm32
573 50/push-EAX
574
575 e8/call check-ints-equal/disp32
576
577 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
578
579 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
580 5d/pop-to-EBP
581 c3/return
582
583 test-slice-starts-with-multiple-characters:
584
585
586 55/push-EBP
587 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
588
589 68/push _test-slice-data-3/imm32/end
590 68/push _test-slice-data-0/imm32/start
591 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
592
593
594 68/push "Ab"/imm32
595 51/push-ECX
596
597 e8/call slice-starts-with?/disp32
598
599 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
600
601
602 68/push "F - test-slice-starts-with-multiple-characters"/imm32
603 68/push 1/imm32
604 50/push-EAX
605
606 e8/call check-ints-equal/disp32
607
608 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
609
610 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
611 5d/pop-to-EBP
612 c3/return
613
614 test-slice-starts-with-entire-string:
615
616
617 55/push-EBP
618 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
619
620 68/push _test-slice-data-3/imm32/end
621 68/push _test-slice-data-0/imm32/start
622 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
623
624
625 68/push "Abc"/imm32
626 51/push-ECX
627
628 e8/call slice-starts-with?/disp32
629
630 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
631
632
633 68/push "F - test-slice-starts-with-entire-string"/imm32
634 68/push 1/imm32
635 50/push-EAX
636
637 e8/call check-ints-equal/disp32
638
639 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
640
641 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
642 5d/pop-to-EBP
643 c3/return
644
645 test-slice-starts-with-fails:
646
647
648 55/push-EBP
649 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
650
651 68/push _test-slice-data-3/imm32/end
652 68/push _test-slice-data-0/imm32/start
653 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
654
655
656 68/push "Abd"/imm32
657 51/push-ECX
658
659 e8/call slice-starts-with?/disp32
660
661 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
662
663
664 68/push "F - test-slice-starts-with-fails"/imm32
665 68/push 0/imm32
666 50/push-EAX
667
668 e8/call check-ints-equal/disp32
669
670 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
671
672 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
673 5d/pop-to-EBP
674 c3/return
675
676 test-slice-starts-with-fails-2:
677
678
679 55/push-EBP
680 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
681
682 68/push _test-slice-data-3/imm32/end
683 68/push _test-slice-data-0/imm32/start
684 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
685
686
687 68/push "Ac"/imm32
688 51/push-ECX
689
690 e8/call slice-starts-with?/disp32
691
692 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
693
694
695 68/push "F - test-slice-starts-with-fails-2"/imm32
696 68/push 0/imm32
697 50/push-EAX
698
699 e8/call check-ints-equal/disp32
700
701 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
702
703 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
704 5d/pop-to-EBP
705 c3/return
706
707 write-slice-buffered:
708
709 55/push-EBP
710 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
711
712 50/push-EAX
713 51/push-ECX
714 52/push-EDX
715 53/push-EBX
716 56/push-ESI
717 57/push-EDI
718
719 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
720
721 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
722
723 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 6/r32/ESI 4/disp8 .
724
725 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 7/r32/EDI 8/disp8 .
726
727 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 2/r32/EDX 0xc/disp8 .
728
729 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 3/r32/EBX 4/disp8 .
730 $write-slice-buffered:loop:
731
732 39/compare 3/mod/direct 1/rm32/ECX . . . 6/r32/ESI . .
733 7d/jump-if-greater-or-equal $write-slice-buffered:loop-end/disp8
734
735 39/compare 3/mod/direct 3/rm32/EBX . . . 2/r32/EDX . .
736 7c/jump-if-lesser $write-slice-buffered:to-stream/disp8
737
738 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 3/r32/EBX 4/disp8 .
739
740
741 57/push-EDI
742
743 e8/call flush/disp32
744
745 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
746
747
748 8d/copy-address 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
749 50/push-EAX
750
751 e8/call clear-stream/disp32
752
753 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
754
755 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
756 $write-slice-buffered:to-stream:
757
758
759 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
760 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
761
762 88/copy-byte 1/mod/*+disp8 4/rm32/sib 7/base/EDI 3/index/EBX . 0/r32/AL 0x10/disp8 .
763
764 43/increment-EBX
765
766 41/increment-ECX
767 eb/jump $write-slice-buffered:loop/disp8
768 $write-slice-buffered:loop-end:
769
770 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 3/r32/EBX 4/disp8 .
771 $write-slice-buffered:end:
772
773 5f/pop-to-EDI
774 5e/pop-to-ESI
775 5b/pop-to-EBX
776 5a/pop-to-EDX
777 59/pop-to-ECX
778 58/pop-to-EAX
779
780 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
781 5d/pop-to-EBP
782 c3/return
783
784 test-write-slice-buffered:
785
786 55/push-EBP
787 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
788
789
790
791 68/push _test-stream/imm32
792
793 e8/call clear-stream/disp32
794
795 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
796
797
798 b8/copy-to-EAX _test-buffered-file/imm32
799 05/add-to-EAX 4/imm32
800 50/push-EAX
801
802 e8/call clear-stream/disp32
803
804 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
805
806 68/push _test-slice-data-3/imm32/end
807 68/push _test-slice-data-0/imm32/start
808 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
809
810
811 51/push-ECX
812 68/push _test-buffered-file/imm32
813
814 e8/call write-slice-buffered/disp32
815
816 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
817
818
819 68/push _test-buffered-file/imm32
820
821 e8/call flush/disp32
822
823 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
824
825
826 68/push "F - test-write-slice-buffered"/imm32
827 68/push "Abc"/imm32
828 68/push _test-stream/imm32
829
830 e8/call check-stream-equal/disp32
831
832 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
833
834 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
835 5d/pop-to-EBP
836 c3/return
837
838
839 slice-to-string:
840
841 55/push-EBP
842 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
843
844 51/push-ECX
845 52/push-EDX
846 53/push-EBX
847 56/push-ESI
848
849 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
850
851 8b/copy 0/mod/indirect 6/rm32/ESI . . . 2/r32/EDX . .
852
853 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 3/r32/EBX 4/disp8 .
854
855 89/copy 3/mod/direct 1/rm32/ECX . . . 3/r32/EBX . .
856 29/subtract 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
857 81 0/subop/add 3/mod/direct 1/rm32/ECX . . . . . 4/imm32
858
859
860 51/push-ECX
861 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
862
863 e8/call allocate/disp32
864
865 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
866
867 3d/compare-EAX-and 0/imm32
868 74/jump-if-equal $slice-to-string:abort/disp8
869
870 89/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
871 81 5/subop/subtract 0/mod/indirect 0/rm32/EAX . . . . . 4/imm32
872
873 50/push-EAX
874
875
876 53/push-EBX
877 52/push-EDX
878
879 01/add 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
880 51/push-ECX
881
882 81 0/subop/add 3/mod/direct 0/rm32/EAX . . . . . 4/imm32
883 50/push-EAX
884
885 e8/call _append-4/disp32
886
887 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
888
889 58/pop-to-EAX
890 $slice-to-string:end:
891
892 5e/pop-to-ESI
893 5b/pop-to-EBX
894 5a/pop-to-EDX
895 59/pop-to-ECX
896
897 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
898 5d/pop-to-EBP
899 c3/return
900
901 $slice-to-string:abort:
902
903
904 68/push "slice-to-string: out of space\n"/imm32
905 68/push 2/imm32/stderr
906
907 e8/call _write/disp32
908
909 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
910
911 bb/copy-to-EBX 1/imm32
912 b8/copy-to-EAX 1/imm32/exit
913 cd/syscall 0x80/imm8
914
915
916 test-slice-to-string:
917
918 55/push-EBP
919 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
920
921 68/push 0/imm32/limit
922 68/push 0/imm32/curr
923 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
924
925
926 52/push-EDX
927 68/push 0x200/imm32
928
929 e8/call new-segment/disp32
930
931 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
932
933 68/push _test-slice-data-3/imm32/end
934 68/push _test-slice-data-0/imm32/start
935 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
936
937
938 51/push-ECX
939 52/push-EDX
940
941 e8/call slice-to-string/disp32
942
943 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
944 +-- 26 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
970
971
972 68/push "Abc"/imm32
973 50/push-EAX
974
975 e8/call string-equal?/disp32
976
977 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
978
979
980 68/push "F - test-slice-to-string"/imm32
981 68/push 1/imm32/true
982 50/push-EAX
983
984 e8/call check-ints-equal/disp32
985
986 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
987
988 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
989 5d/pop-to-EBP
990 c3/return
991
992 == data
993
994 _test-slice-data-0:
995 41/A
996 _test-slice-data-1:
997 62/b
998 _test-slice-data-2:
999 63/c
1000 _test-slice-data-3:
1001 64/d
1002 _test-slice-data-4:
1003
1004