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