https://github.com/akkartik/mu/blob/master/subx/apps/pack.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 == code
19
20
21
22
23 Entry:
24
25
26
27
28
29
30
31 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
32
33
34 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0/disp8 1/imm32
35 7e/jump-if-lesser-or-equal $run-main/disp8
36
37
38 68/push "test"/imm32
39 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
40
41 e8/call kernel-string-equal?/disp32
42
43 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
44
45 3d/compare-EAX 1/imm32
46 75/jump-if-not-equal $run-main/disp8
47
48 e8/call run-tests/disp32
49 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32
50 eb/jump $main:end/disp8
51 $run-main:
52
53
54 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
55 89/copy 3/mod/direct 0/rm32/EAX . . . 4/r32/ESP . .
56
57
58 c7 0/subop/copy 0/mod/direct 0/rm32/EAX . . . . . 0/imm32
59
60
61 50/push-EAX/ed
62 68/push Stderr/imm32
63 68/push Stdout/imm32
64 68/push Stdin/imm32
65
66 e8/call convert/disp32
67
68 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
69
70 bb/copy-to-EBX 0/imm32
71 $main:end:
72 b8/copy-to-EAX 1/imm32/exit
73 cd/syscall 0x80/imm8
74
75
76
77
78
79
80
81
82
83
84
85
86 convert:
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105 55/push-EBP
106 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
107
108 51/push-ECX
109
110 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x200/imm32
111 68/push 0x200/imm32/length
112 68/push 0/imm32/read
113 68/push 0/imm32/write
114 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
115 $convert:loop:
116
117
118 51/push-ECX
119
120 e8/call clear-stream/disp32
121
122 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
123
124
125 51/push-ECX
126 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
127
128 e8/call convert-instruction/disp32
129
130 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
131
132 3d/compare-with-EAX 0xffffffff/imm32/Eof
133 74/jump-if-equal $convert:break/disp8
134
135
136 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
137 51/push-ECX
138
139 e8/call convert-instruction/disp32
140
141 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
142 $convert:break:
143
144
145 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
146
147 e8/call flush/disp32
148
149 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
150 $convert:end:
151
152 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x20c/imm32
153
154 59/pop-to-ECX
155
156 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
157 5d/pop-to-EBP
158 c3/return
159
160 convert-code-segment:
161
162
163
164
165
166
167
168
169
170
171
172 convert-data-segment:
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 convert-instruction:
234
235
236
237
238
239
240
241
242
243
244 55/push-EBP
245 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
246
247 51/push-ECX
248
249 68/push 0/imm32/end
250 68/push 0/imm32/start
251 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
252
253
254 51/push-ECX
255 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
256
257 e8/call next-word/disp32
258
259 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
260 $convert-instruction:pass-line-through:
261
262
263 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
264 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
265
266 e8/call write-stream-buffered/disp32
267
268 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
269 $convert-instruction:end:
270
271 59/pop-to-ECX
272
273 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
274 5d/pop-to-EBP
275 c3/return
276
277 test-convert-instruction-passes-comments-through:
278
279
280 55/push-EBP
281 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
282
283
284
285 68/push _test-stream/imm32
286
287 e8/call clear-stream/disp32
288
289 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
290
291
292 b8/copy-to-EAX _test-buffered-file/imm32
293 05/add-to-EAX 4/imm32
294 50/push-EAX
295
296 e8/call clear-stream/disp32
297
298 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
299
300
301 68/push _test-tmp-stream/imm32
302
303 e8/call clear-stream/disp32
304
305 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
306
307
308
309 68/push "# abcd"/imm32
310 68/push _test-tmp-stream/imm32
311
312 e8/call write/disp32
313
314 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
315
316
317 68/push _test-buffered-file/imm32
318 68/push _test-tmp-stream/imm32
319
320 e8/call convert-instruction/disp32
321
322 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
323
324
325
326 68/push _test-buffered-file/imm32
327
328 e8/call flush/disp32
329
330 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
331
332
333 68/push "F - test-convert-instruction-passes-comments-through"/imm32
334 68/push "# abcd"/imm32
335 68/push _test-stream/imm32
336
337 e8/call check-stream-equal/disp32
338
339 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
340
341 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
342 5d/pop-to-EBP
343 c3/return
344
345 test-convert-instruction-passes-segment-headers-through:
346
347
348 55/push-EBP
349 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
350
351
352
353 68/push _test-stream/imm32
354
355 e8/call clear-stream/disp32
356
357 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
358
359
360 b8/copy-to-EAX _test-buffered-file/imm32
361 05/add-to-EAX 4/imm32
362 50/push-EAX
363
364 e8/call clear-stream/disp32
365
366 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
367
368
369 68/push _test-tmp-stream/imm32
370
371 e8/call clear-stream/disp32
372
373 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
374
375
376
377 68/push "== abcd"/imm32
378 68/push _test-tmp-stream/imm32
379
380 e8/call write/disp32
381
382 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
383
384
385 68/push _test-buffered-file/imm32
386 68/push _test-tmp-stream/imm32
387
388 e8/call convert-instruction/disp32
389
390 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
391
392
393
394 68/push _test-buffered-file/imm32
395
396 e8/call flush/disp32
397
398 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
399
400
401 68/push "F - test-convert-instruction-passes-segment-headers-through"/imm32
402 68/push "== abcd"/imm32
403 68/push _test-stream/imm32
404
405 e8/call check-stream-equal/disp32
406
407 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
408
409 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
410 5d/pop-to-EBP
411 c3/return
412
413 test-convert-instruction-passes-empty-lines-through:
414
415
416 55/push-EBP
417 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
418
419
420
421 68/push _test-stream/imm32
422
423 e8/call clear-stream/disp32
424
425 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
426
427
428 b8/copy-to-EAX _test-buffered-file/imm32
429 05/add-to-EAX 4/imm32
430 50/push-EAX
431
432 e8/call clear-stream/disp32
433
434 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
435
436
437 68/push _test-tmp-stream/imm32
438
439 e8/call clear-stream/disp32
440
441 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
442
443
444
445 68/push _test-buffered-file/imm32
446 68/push _test-tmp-stream/imm32
447
448 e8/call convert-instruction/disp32
449
450 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
451
452
453
454 68/push _test-buffered-file/imm32
455
456 e8/call flush/disp32
457
458 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
459
460
461 68/push "F - test-convert-instruction-passes-empty-lines-through"/imm32
462 68/push ""/imm32
463 68/push _test-stream/imm32
464
465 e8/call check-stream-equal/disp32
466
467 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
468
469 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
470 5d/pop-to-EBP
471 c3/return
472
473 test-convert-instruction-passes-lines-with-just-whitespace-through:
474
475
476 55/push-EBP
477 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
478
479
480
481 68/push _test-stream/imm32
482
483 e8/call clear-stream/disp32
484
485 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
486
487
488 b8/copy-to-EAX _test-buffered-file/imm32
489 05/add-to-EAX 4/imm32
490 50/push-EAX
491
492 e8/call clear-stream/disp32
493
494 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
495
496
497 68/push _test-tmp-stream/imm32
498
499 e8/call clear-stream/disp32
500
501 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
502
503
504
505 68/push " "/imm32
506 68/push _test-tmp-stream/imm32
507
508 e8/call write/disp32
509
510 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
511
512
513 68/push _test-buffered-file/imm32
514 68/push _test-tmp-stream/imm32
515
516 e8/call convert-instruction/disp32
517
518 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
519
520
521
522 68/push _test-buffered-file/imm32
523
524 e8/call flush/disp32
525
526 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
527
528
529 68/push "F - test-convert-instruction-passes-with-just-whitespace-through"/imm32
530 68/push " "/imm32
531 68/push _test-stream/imm32
532
533 e8/call check-stream-equal/disp32
534
535 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
536
537 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
538 5d/pop-to-EBP
539 c3/return
540
541 test-convert-instruction-passes-labels-through:
542
543
544 55/push-EBP
545 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
546
547
548
549 68/push _test-stream/imm32
550
551 e8/call clear-stream/disp32
552
553 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
554
555
556 b8/copy-to-EAX _test-buffered-file/imm32
557 05/add-to-EAX 4/imm32
558 50/push-EAX
559
560 e8/call clear-stream/disp32
561
562 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
563
564
565 68/push _test-tmp-stream/imm32
566
567 e8/call clear-stream/disp32
568
569 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
570
571
572
573 68/push "ab: # cd"/imm32
574 68/push _test-tmp-stream/imm32
575
576 e8/call write/disp32
577
578 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
579
580
581 68/push _test-buffered-file/imm32
582 68/push _test-tmp-stream/imm32
583
584 e8/call convert-instruction/disp32
585
586 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
587
588
589
590 68/push _test-buffered-file/imm32
591
592 e8/call flush/disp32
593
594 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
595
596
597 68/push "F - test-convert-instruction-passes-labels-through"/imm32
598 68/push "ab: # cd"/imm32
599 68/push _test-stream/imm32
600
601 e8/call check-stream-equal/disp32
602
603 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
604
605 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
606 5d/pop-to-EBP
607 c3/return
608
609
610 next-word:
611
612 55/push-EBP
613 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
614
615 50/push-EAX
616 51/push-ECX
617 56/push-ESI
618 57/push-EDI
619
620 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
621
622 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 .
623
624
625 68/push 0x20/imm32/space
626 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
627
628 e8/call skip-chars-matching/disp32
629
630 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
631
632 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
633 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
634 89/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . .
635
636
637 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
638 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
639
640 3d/compare-EAX-with 0x23/imm32/pound
641 75/jump-if-not-equal $next-word:not-comment/disp8
642
643 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
644 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
645 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
646
647 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
648
649 eb/jump $next-word:end/disp8
650 $next-word:not-comment:
651
652
653 68/push 0x20/imm32/space
654 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
655
656 e8/call skip-chars-not-matching/disp32
657
658 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
659
660 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
661 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
662 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
663 $next-word:end:
664
665 5f/pop-to-EDI
666 5e/pop-to-ESI
667 59/pop-to-ECX
668 58/pop-to-EAX
669
670 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
671 5d/pop-to-EBP
672 c3/return
673
674 test-next-word:
675
676 55/push-EBP
677 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
678
679
680
681 68/push _test-stream/imm32
682
683 e8/call clear-stream/disp32
684
685 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
686
687 68/push 0/imm32/end
688 68/push 0/imm32/start
689 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
690
691
692 68/push " ab"/imm32
693 68/push _test-stream/imm32
694
695 e8/call write/disp32
696
697 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
698
699
700 51/push-ECX
701 68/push _test-stream/imm32
702
703 e8/call next-word/disp32
704
705 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
706
707
708
709 68/push "F - test-next-word: start"/imm32
710 68/push 0xe/imm32
711
712 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
713 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
714 50/push-EAX
715
716 e8/call check-ints-equal/disp32
717
718 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
719
720
721
722 68/push "F - test-next-word: end"/imm32
723 68/push 0x10/imm32
724
725 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
726 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
727 50/push-EAX
728
729 e8/call check-ints-equal/disp32
730
731 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
732
733 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
734 5d/pop-to-EBP
735 c3/return
736
737 test-next-word-returns-whole-comment:
738
739 55/push-EBP
740 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
741
742
743
744 68/push _test-stream/imm32
745
746 e8/call clear-stream/disp32
747
748 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
749
750 68/push 0/imm32/end
751 68/push 0/imm32/start
752 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
753
754
755 68/push " # a"/imm32
756 68/push _test-stream/imm32
757
758 e8/call write/disp32
759
760 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
761
762
763 51/push-ECX
764 68/push _test-stream/imm32
765
766 e8/call next-word/disp32
767
768 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
769
770
771
772 68/push "F - test-next-word-returns-whole-comment: start"/imm32
773 68/push 0xe/imm32
774
775 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
776 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
777 50/push-EAX
778
779 e8/call check-ints-equal/disp32
780
781 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
782
783
784
785 68/push "F - test-next-word-returns-whole-comment: end"/imm32
786 68/push 0x11/imm32
787
788 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
789 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-stream/imm32
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
796 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
797 5d/pop-to-EBP
798 c3/return
799
800 has-metadata?:
801
802
803
804
805
806
807
808
809
810
811 55/push-EBP
812 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
813
814 51/push-ECX
815 52/push-EDX
816 56/push-ESI
817 57/push-EDI
818
819 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
820
821 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 .
822
823 68/push 0/imm32/end
824 68/push 0/imm32/start
825 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
826
827
828 57/push-EDI
829 68/push 0x2f/imm32/slash
830 52/push-EDX
831 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
832
833 e8/call next-token-from-slice/disp32
834
835 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
836
837 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
838 $has-metadata?:loop:
839
840
841 57/push-EDI
842 68/push 0x2f/imm32/slash
843 52/push-EDX
844 51/push-ECX
845
846 e8/call next-token-from-slice/disp32
847
848 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
849
850
851
852 57/push-EDI
853
854 e8/call slice-empty?/disp32
855
856 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
857
858 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0/imm32
859 75/compare-if-not-equal $has-metadata?:false/disp8
860
861
862
863 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
864 57/push-EDI
865
866 e8/call slice-equal?/disp32
867
868 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
869
870 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0/imm32
871 75/compare-if-not-equal $has-metadata?:true/disp8
872
873 8b/copy 1/mod/*+disp8 7/rm32/EDI . . . 1/r32/ECX 4/disp8 .
874 eb/jump $has-metadata?:loop/disp8
875 $has-metadata?:true:
876 b8/copy-to-EAX 1/imm32/true
877 eb/jump $has-metadata?:end/disp8
878 $has-metadata?:false:
879 b8/copy-to-EAX 0/imm32/false
880 $has-metadata?:end:
881
882 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
883
884 5f/pop-to-EDI
885 5e/pop-to-ESI
886 5a/pop-to-EDX
887 59/pop-to-ECX
888
889 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
890 5d/pop-to-EBP
891 c3/return
892
893 test-has-metadata-true:
894
895 55/push-EBP
896 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
897
898 b8/copy-to-EAX "ab/c"/imm32
899 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
900 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
901 05/add-to-EAX 4/imm32
902
903 51/push-ECX
904 50/push-EAX
905 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
906
907
908 68/push "c"/imm32
909 56/push-ESI
910
911 e8/call has-metadata?/disp32
912
913 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
914
915
916 68/push "F - test-has-metadata-true"/imm32
917 68/push 1/imm32/true
918 50/push-EAX
919
920 e8/call check-ints-equal/disp32
921
922 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
923
924 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
925 5d/pop-to-EBP
926 c3/return
927
928 test-has-metadata-false:
929
930 55/push-EBP
931 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
932
933 b8/copy-to-EAX "ab/c"/imm32
934 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
935 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
936 05/add-to-EAX 4/imm32
937
938 51/push-ECX
939 50/push-EAX
940 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
941
942
943 68/push "d"/imm32
944 56/push-ESI
945
946 e8/call has-metadata?/disp32
947
948 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
949
950
951 68/push "F - test-has-metadata-false"/imm32
952 68/push 0/imm32/false
953 50/push-EAX
954
955 e8/call check-ints-equal/disp32
956
957 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
958
959 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
960 5d/pop-to-EBP
961 c3/return
962
963 test-has-metadata-ignore-name:
964
965 55/push-EBP
966 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
967
968 b8/copy-to-EAX "a/b"/imm32
969 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
970 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
971 05/add-to-EAX 4/imm32
972
973 51/push-ECX
974 50/push-EAX
975 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
976
977
978 68/push "a"/imm32
979 56/push-ESI
980
981 e8/call has-metadata?/disp32
982
983 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
984
985
986 68/push "F - test-has-metadata-ignore-name"/imm32
987 68/push 0/imm32/false
988 50/push-EAX
989
990 e8/call check-ints-equal/disp32
991
992 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
993
994 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
995 5d/pop-to-EBP
996 c3/return
997
998 test-has-metadata-multiple-true:
999
1000 55/push-EBP
1001 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1002
1003 b8/copy-to-EAX "a/b/c"/imm32
1004 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1005 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1006 05/add-to-EAX 4/imm32
1007
1008 51/push-ECX
1009 50/push-EAX
1010 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
1011
1012
1013 68/push "c"/imm32
1014 56/push-ESI
1015
1016 e8/call has-metadata?/disp32
1017
1018 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
1019
1020
1021 68/push "F - test-has-metadata-multiple-true"/imm32
1022 68/push 1/imm32/true
1023 50/push-EAX
1024
1025 e8/call check-ints-equal/disp32
1026
1027 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1028
1029 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1030 5d/pop-to-EBP
1031 c3/return
1032
1033 test-has-metadata-multiple-false:
1034
1035 55/push-EBP
1036 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1037
1038 b8/copy-to-EAX "a/b/c"/imm32
1039 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1040 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1041 05/add-to-EAX 4/imm32
1042
1043 51/push-ECX
1044 50/push-EAX
1045 89/copy 3/mod/direct 6/rm32/ESI . . . 4/r32/ESP . .
1046
1047
1048 68/push "d"/imm32
1049 56/push-ESI
1050
1051 e8/call has-metadata?/disp32
1052
1053 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x8/imm32
1054
1055
1056 68/push "F - test-has-metadata-multiple-false"/imm32
1057 68/push 0/imm32/false
1058 50/push-EAX
1059
1060 e8/call check-ints-equal/disp32
1061
1062 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1063
1064 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1065 5d/pop-to-EBP
1066 c3/return
1067
1068
1069
1070 emit:
1071
1072 55/push-EBP
1073 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1074
1075 50/push-EAX
1076 56/push-ESI
1077 57/push-EDI
1078
1079 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 0xc/disp8 .
1080
1081 68/push 0/imm32/end
1082 68/push 0/imm32/start
1083 89/copy 3/mod/direct 7/rm32/EDI . . . 4/r32/ESP . .
1084
1085
1086 57/push-EDI
1087 68/push 0x2f/imm32/slash
1088 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
1089 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
1090
1091 e8/call next-token-from-slice/disp32
1092
1093 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
1094
1095
1096
1097 57/push-EDI
1098
1099 e8/call is-hex-int?/disp32
1100
1101 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1102
1103 81 7/subop/compare 3/mod/direct 0/rm32/EAX . . . . . 0/imm32
1104 75/jump-if-not-equal $emit:hex-int/disp8
1105
1106
1107 56/push-ESI
1108 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1109
1110 e8/call write-slice/disp32
1111
1112 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1113
1114 eb/jump $emit:end/disp8
1115
1116 $emit:hex-int:
1117
1118
1119 57/push-EDI
1120
1121 e8/call parse-hex-int/disp32
1122
1123 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1124
1125
1126 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
1127 50/push-EAX
1128 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1129
1130 e8/call emit-hex/disp32
1131
1132 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1133 $emit:end:
1134
1135 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1136
1137 5f/pop-to-EDI
1138 5e/pop-to-ESI
1139 58/pop-to-EAX
1140
1141 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1142 5d/pop-to-EBP
1143 c3/return
1144
1145 test-emit-number:
1146
1147 55/push-EBP
1148 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1149
1150
1151
1152 68/push _test-stream/imm32
1153
1154 e8/call clear-stream/disp32
1155
1156 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1157
1158
1159 b8/copy-to-EAX _test-buffered-file/imm32
1160 05/add-to-EAX 4/imm32
1161 50/push-EAX
1162
1163 e8/call clear-stream/disp32
1164
1165 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1166
1167 68/push _test-slice-negative-two-end/imm32/end
1168 68/push _test-slice-negative-two/imm32/start
1169 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1170
1171
1172 68/push 2/imm32
1173 51/push-ECX
1174 68/push _test-buffered-file/imm32
1175
1176 e8/call emit/disp32
1177
1178 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1179
1180
1181 68/push _test-buffered-file/imm32
1182
1183 e8/call flush/disp32
1184
1185 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1186
1187
1188
1189 68/push "F - test-emit-number/1"/imm32
1190 68/push 0x66206566/imm32
1191
1192 b8/copy-to-EAX _test-stream/imm32
1193 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1194
1195 e8/call check-ints-equal/disp32
1196
1197 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1198
1199
1200 68/push "F - test-emit-number/2"/imm32
1201 68/push 0x2066/imm32
1202
1203 b8/copy-to-EAX _test-stream/imm32
1204 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1205
1206 e8/call check-ints-equal/disp32
1207
1208 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1209
1210 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1211 5d/pop-to-EBP
1212 c3/return
1213
1214 test-emit-number-with-metadata:
1215
1216 55/push-EBP
1217 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1218
1219
1220
1221 68/push _test-stream/imm32
1222
1223 e8/call clear-stream/disp32
1224
1225 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1226
1227
1228 b8/copy-to-EAX _test-buffered-file/imm32
1229 05/add-to-EAX 4/imm32
1230 50/push-EAX
1231
1232 e8/call clear-stream/disp32
1233
1234 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1235
1236 68/push _test-slice-negative-two-metadata-end/imm32/end
1237 68/push _test-slice-negative-two/imm32/start
1238 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1239
1240
1241 68/push 2/imm32
1242 51/push-ECX
1243 68/push _test-buffered-file/imm32
1244
1245 e8/call emit/disp32
1246
1247 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1248
1249
1250 68/push _test-buffered-file/imm32
1251
1252 e8/call flush/disp32
1253
1254 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1255
1256
1257
1258
1259 68/push "F - test-emit-number-with-metadata/1"/imm32
1260 68/push 0x66206566/imm32
1261
1262 b8/copy-to-EAX _test-stream/imm32
1263 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1264
1265 e8/call check-ints-equal/disp32
1266
1267 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1268
1269
1270 68/push "F - test-emit-number-with-metadata/2"/imm32
1271 68/push 0x2066/imm32
1272
1273 b8/copy-to-EAX _test-stream/imm32
1274 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1275
1276 e8/call check-ints-equal/disp32
1277
1278 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1279
1280 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1281 5d/pop-to-EBP
1282 c3/return
1283
1284 test-emit-non-number:
1285
1286 55/push-EBP
1287 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1288
1289
1290
1291 68/push _test-stream/imm32
1292
1293 e8/call clear-stream/disp32
1294
1295 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1296
1297
1298 b8/copy-to-EAX _test-buffered-file/imm32
1299 05/add-to-EAX 4/imm32
1300 50/push-EAX
1301
1302 e8/call clear-stream/disp32
1303
1304 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1305
1306 68/push _test-slice-non-number-word-end/imm32/end
1307 68/push _test-slice-non-number-word/imm32/start
1308 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1309
1310
1311 68/push 2/imm32
1312 51/push-ECX
1313 68/push _test-buffered-file/imm32
1314
1315 e8/call emit/disp32
1316
1317 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1318
1319
1320 68/push _test-buffered-file/imm32
1321
1322 e8/call flush/disp32
1323
1324 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1325
1326
1327
1328 68/push "F - test-emit-non-number"/imm32
1329 68/push 0x7a7978/imm32
1330
1331 b8/copy-to-EAX _test-stream/imm32
1332 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1333
1334 e8/call check-ints-equal/disp32
1335
1336 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1337
1338 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1339 5d/pop-to-EBP
1340 c3/return
1341
1342 test-emit-non-number-with-metadata:
1343
1344 55/push-EBP
1345 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1346
1347
1348
1349 68/push _test-stream/imm32
1350
1351 e8/call clear-stream/disp32
1352
1353 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1354
1355
1356 b8/copy-to-EAX _test-buffered-file/imm32
1357 05/add-to-EAX 4/imm32
1358 50/push-EAX
1359
1360 e8/call clear-stream/disp32
1361
1362 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1363
1364 68/push _test-slice-non-number-word-metadata-end/imm32/end
1365 68/push _test-slice-non-number-word/imm32/start
1366 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1367
1368
1369 68/push 2/imm32
1370 51/push-ECX
1371 68/push _test-buffered-file/imm32
1372
1373 e8/call emit/disp32
1374
1375 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1376
1377
1378 68/push _test-buffered-file/imm32
1379
1380 e8/call flush/disp32
1381
1382 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1383
1384
1385
1386 68/push "F - test-emit-non-number-with-metadata"/imm32
1387 68/push 0x2f7a7978/imm32
1388
1389 b8/copy-to-EAX _test-stream/imm32
1390 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1391
1392 e8/call check-ints-equal/disp32
1393
1394 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1395
1396 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1397 5d/pop-to-EBP
1398 c3/return
1399
1400
1401 emit-hex:
1402
1403 55/push-EBP
1404 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1405
1406 50/push-EAX
1407 51/push-ECX
1408 52/push-EDX
1409 53/push-EBX
1410 57/push-EDI
1411
1412 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 8/disp8 .
1413
1414 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 3/r32/EBX 0xc/disp8 .
1415
1416 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 2/r32/EDX 0x10/disp8 .
1417
1418 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . .
1419 $emit-hex:loop:
1420
1421 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
1422 7d/jump-if-greater-or-equal $emit-hex:end/disp8
1423
1424
1425 53/push-EBX
1426 57/push-EDI
1427
1428 e8/call print-byte/disp32
1429
1430 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1431
1432
1433 68/push 0x20/imm32/space
1434 57/push-EDI
1435
1436 e8/call write-byte/disp32
1437
1438 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1439
1440 c1/shift 5/subop/logic-right 3/mod/direct 3/rm32/EBX . . . . . 8/imm8
1441
1442 41/increment-ECX
1443 eb/jump $emit-hex:loop/disp8
1444 $emit-hex:end:
1445
1446 5f/pop-to-EDI
1447 5b/pop-to-EBX
1448 5a/pop-to-EAX
1449 59/pop-to-ECX
1450 58/pop-to-EAX
1451
1452 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1453 5d/pop-to-EBP
1454 c3/return
1455
1456 test-emit-hex-single-byte:
1457
1458
1459
1460 68/push _test-stream/imm32
1461
1462 e8/call clear-stream/disp32
1463
1464 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1465
1466
1467 b8/copy-to-EAX _test-buffered-file/imm32
1468 05/add-to-EAX 4/imm32
1469 50/push-EAX
1470
1471 e8/call clear-stream/disp32
1472
1473 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1474
1475
1476 68/push 1/imm32
1477 68/push 0xab/imm32
1478 68/push _test-buffered-file/imm32
1479
1480 e8/call emit-hex/disp32
1481
1482 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1483
1484
1485 68/push _test-buffered-file/imm32
1486
1487 e8/call flush/disp32
1488
1489 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1490
1491
1492 68/push "F - test-emit-hex-single-byte"/imm32
1493 68/push 0x206261/imm32
1494
1495 b8/copy-to-EAX _test-stream/imm32
1496 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1497
1498 e8/call check-ints-equal/disp32
1499
1500 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1501
1502 c3/return
1503
1504 test-emit-hex-multiple-byte:
1505
1506
1507
1508 68/push _test-stream/imm32
1509
1510 e8/call clear-stream/disp32
1511
1512 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1513
1514
1515 b8/copy-to-EAX _test-buffered-file/imm32
1516 05/add-to-EAX 4/imm32
1517 50/push-EAX
1518
1519 e8/call clear-stream/disp32
1520
1521 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1522
1523
1524 68/push 2/imm32
1525 68/push 0x1234/imm32
1526 68/push _test-buffered-file/imm32
1527
1528 e8/call emit-hex/disp32
1529
1530 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1531
1532
1533 68/push _test-buffered-file/imm32
1534
1535 e8/call flush/disp32
1536
1537 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1538
1539
1540
1541 68/push "F - test-emit-hex-multiple-byte/1"/imm32
1542 68/push 0x31203433/imm32
1543
1544 b8/copy-to-EAX _test-stream/imm32
1545 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1546
1547 e8/call check-ints-equal/disp32
1548
1549 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1550
1551
1552 68/push "F - test-emit-hex-multiple-byte/2"/imm32
1553 68/push 0x2032/imm32
1554
1555 b8/copy-to-EAX _test-stream/imm32
1556 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1557
1558 e8/call check-ints-equal/disp32
1559
1560 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1561
1562 c3/return
1563
1564 test-emit-hex-zero-pad:
1565
1566
1567
1568 68/push _test-stream/imm32
1569
1570 e8/call clear-stream/disp32
1571
1572 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1573
1574
1575 b8/copy-to-EAX _test-buffered-file/imm32
1576 05/add-to-EAX 4/imm32
1577 50/push-EAX
1578
1579 e8/call clear-stream/disp32
1580
1581 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1582
1583
1584 68/push 2/imm32
1585 68/push 0xab/imm32
1586 68/push _test-buffered-file/imm32
1587
1588 e8/call emit-hex/disp32
1589
1590 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1591
1592
1593 68/push _test-buffered-file/imm32
1594
1595 e8/call flush/disp32
1596
1597 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1598
1599
1600
1601 68/push "F - test-emit-hex-zero-pad/1"/imm32
1602 68/push 0x30206261/imm32
1603
1604 b8/copy-to-EAX _test-stream/imm32
1605 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1606
1607 e8/call check-ints-equal/disp32
1608
1609 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1610
1611
1612 68/push "F - test-emit-hex-zero-pad/2"/imm32
1613 68/push 0x2030/imm32
1614
1615 b8/copy-to-EAX _test-stream/imm32
1616 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1617
1618 e8/call check-ints-equal/disp32
1619
1620 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1621
1622 c3/return
1623
1624 test-emit-hex-negative:
1625
1626
1627
1628 68/push _test-stream/imm32
1629
1630 e8/call clear-stream/disp32
1631
1632 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1633
1634
1635 b8/copy-to-EAX _test-buffered-file/imm32
1636 05/add-to-EAX 4/imm32
1637 50/push-EAX
1638
1639 e8/call clear-stream/disp32
1640
1641 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1642
1643
1644 68/push 2/imm32
1645 68/push -1/imm32
1646 68/push _test-buffered-file/imm32
1647
1648 e8/call emit-hex/disp32
1649
1650 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1651
1652
1653 68/push _test-buffered-file/imm32
1654
1655 e8/call flush/disp32
1656
1657 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1658
1659
1660
1661 68/push "F - test-emit-hex-negative/1"/imm32
1662 68/push 0x66206666/imm32
1663
1664 b8/copy-to-EAX _test-stream/imm32
1665 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0xc/disp8 .
1666
1667 e8/call check-ints-equal/disp32
1668
1669 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1670
1671
1672 68/push "F - test-emit-hex-negative/2"/imm32
1673 68/push 0x2066/imm32
1674
1675 b8/copy-to-EAX _test-stream/imm32
1676 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 0x10/disp8 .
1677
1678 e8/call check-ints-equal/disp32
1679
1680 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1681
1682 c3/return
1683
1684 == data
1685
1686 _test-slice-negative-two:
1687 2d/- 32/2
1688 _test-slice-negative-two-end:
1689 2f/slash 66/f 6f/o 6f/o
1690 _test-slice-negative-two-metadata-end:
1691
1692 _test-slice-non-number-word:
1693 78/x 79/y 7a/z
1694 _test-slice-non-number-word-end:
1695 2f/slash
1696 _test-slice-non-number-word-metadata-end:
1697
1698