https://github.com/akkartik/mu/blob/master/apps/desugar.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 == code
39
40
41
42
43 Entry:
44
45
46
47 68/push Heap/imm32
48 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
49
50 e8/call new-segment/disp32
51
52 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
53
54
55
56 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
57
58
59 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0/disp8 1/imm32
60 7e/jump-if-lesser-or-equal $run-main/disp8
61
62
63 68/push "test"/imm32
64 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
65
66 e8/call kernel-string-equal?/disp32
67
68 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
69
70 3d/compare-EAX-and 1/imm32
71 75/jump-if-not-equal $run-main/disp8
72
73 e8/call run-tests/disp32
74 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32
75 eb/jump $main:end/disp8
76 $run-main:
77
78
79
80 68/push Stdout/imm32
81 68/push Stdin/imm32
82
83 e8/call convert/disp32
84
85 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
86
87 bb/copy-to-EBX 0/imm32
88 $main:end:
89 b8/copy-to-EAX 1/imm32/exit
90 cd/syscall 0x80/imm8
91
92
93
94 convert:
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 55/push-EBP
122 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
123
124 50/push-EAX
125 51/push-ECX
126 52/push-EDX
127 53/push-EBX
128
129 81 5/subop/subtract 3/mod/direct 4/rm32/ESP . . . . . 0x200/imm32
130 68/push 0x200/imm32/length
131 68/push 0/imm32/read
132 68/push 0/imm32/write
133 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
134
135 68/push 0/imm32/end
136 68/push 0/imm32/start
137 89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . .
138 $convert:line-loop:
139
140
141 51/push-ECX
142
143 e8/call clear-stream/disp32
144
145 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
146
147
148 51/push-ECX
149 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
150
151 e8/call read-line-buffered/disp32
152
153 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
154 $convert:check0:
155
156 81 7/subop/compare 0/mod/indirect 1/rm32/ECX . . . . . 0/imm32
157 0f 84/jump-if-equal $convert:break/disp32
158 $convert:word-loop:
159
160
161 52/push-EDX
162 51/push-ECX
163
164 e8/call next-word-or-expression/disp32
165
166 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
167 $convert:check1:
168
169
170
171 52/push-EDX
172
173 e8/call slice-empty?/disp32
174
175 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
176
177 3d/compare-EAX-and 0/imm32
178 0f 85/jump-if-not-equal $convert:next-line/disp32
179 $convert:check-for-comment:
180
181
182 8b/copy 0/mod/indirect 2/rm32/EDX . . . 3/r32/EBX . .
183
184 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
185 8a/copy-byte 0/mod/indirect 3/rm32/EBX . . . 0/r32/AL . .
186
187 3d/compare-EAX-and 0x23/imm32/hash
188 74/jump-if-equal $convert:word-loop/disp8
189 $convert:check-for-direct-mode:
190
191 3d/compare-EAX-and 0x25/imm32/percent
192 75/jump-if-not-equal $convert:check-for-indirect-mode/disp8
193 $convert:direct-mode:
194 +-- 46 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
240
241
242 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
243 52/push-EDX
244
245 e8/call emit-direct-mode/disp32
246
247 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
248
249 e9/jump $convert:next-word/disp32
250 $convert:check-for-indirect-mode:
251
252 3d/compare-EAX-and 0x2a/imm32/asterisk
253 75/jump-if-not-equal $convert:check-for-invalid-addition/disp8
254 $convert:indirect-mode:
255
256 50/push-EAX
257 51/push-ECX
258 52/push-EDX
259 53/push-EBX
260
261
262 52/push-EDX
263
264 e8/call parse-effective-address/disp32
265
266 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
267
268
269 53/push-EBX
270 52/push-EDX
271 51/push-ECX
272 50/push-EAX
273 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
274
275 e8/call emit-indirect-mode/disp32
276
277 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x14/imm32
278
279 5b/pop-to-EBX
280 5a/pop-to-EDX
281 59/pop-to-ECX
282 58/pop-to-EAX
283
284 e9/jump $convert:next-word/disp32
285 $convert:check-for-invalid-addition:
286
287 3d/compare-EAX-and 0x2b/imm32/plus
288 74/jump-if-equal $convert:error1/disp8
289 $convert:check-for-invalid-left-shift:
290
291 3d/compare-EAX-and 0x3c/imm32/less-than
292 74/jump-if-equal $convert:error1/disp8
293 $convert:regular-word:
294
295
296 52/push-EDX
297 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
298
299 e8/call write-slice-buffered/disp32
300
301 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
302
303 $convert:next-word:
304
305
306 68/push " "/imm32
307 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
308
309 e8/call write-buffered/disp32
310
311 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
312
313 e9/jump $convert:word-loop/disp32
314 $convert:next-line:
315
316
317 68/push Newline/imm32
318 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
319
320 e8/call write-buffered/disp32
321
322 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
323
324 e9/jump $convert:line-loop/disp32
325 $convert:break:
326
327
328 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
329
330 e8/call flush/disp32
331
332 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
333 $convert:end:
334
335 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x214/imm32
336
337 5b/pop-to-EBX
338 5a/pop-to-EDX
339 59/pop-to-ECX
340 58/pop-to-EAX
341
342 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
343 5d/pop-to-EBP
344 c3/return
345
346 $convert:error1:
347
348
349
350 68/push "error: '"/imm32
351 68/push Stderr/imm32
352
353 e8/call write-buffered/disp32
354
355 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
356
357
358 50/push-EAX
359 68/push Stderr/imm32
360
361 e8/call write-byte-buffered/disp32
362
363 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
364
365
366 68/push "' only permitted within '*(...)' in '"/imm32
367 68/push Stderr/imm32
368
369 e8/call write-buffered/disp32
370
371 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
372
373
374 51/push-ECX
375 68/push Stderr/imm32
376
377 e8/call write-stream-data/disp32
378
379 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
380
381
382 68/push "'"/imm32
383 68/push Stderr/imm32
384
385 e8/call write-buffered/disp32
386
387 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
388
389
390 68/push Stderr/imm32
391
392 e8/call flush/disp32
393
394 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
395
396 bb/copy-to-EBX 1/imm32
397 b8/copy-to-EAX 1/imm32/exit
398 cd/syscall 0x80/imm8
399
400
401 test-convert-passes-most-words-through:
402
403 55/push-EBP
404 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
405
406
407
408 68/push _test-input-stream/imm32
409
410 e8/call clear-stream/disp32
411
412 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
413
414
415 b8/copy-to-EAX _test-input-buffered-file/imm32
416 05/add-to-EAX 4/imm32
417 50/push-EAX
418
419 e8/call clear-stream/disp32
420
421 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
422
423
424 68/push _test-output-stream/imm32
425
426 e8/call clear-stream/disp32
427
428 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
429
430
431 b8/copy-to-EAX _test-output-buffered-file/imm32
432 05/add-to-EAX 4/imm32
433 50/push-EAX
434
435 e8/call clear-stream/disp32
436
437 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
438
439
440
441 68/push "== abcd 0x1"/imm32
442 68/push _test-input-stream/imm32
443
444 e8/call write/disp32
445
446 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
447
448
449 68/push _test-output-buffered-file/imm32
450 68/push _test-input-buffered-file/imm32
451
452 e8/call convert/disp32
453
454 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
455
456
457
458 68/push _test-output-buffered-file/imm32
459
460 e8/call flush/disp32
461
462 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
463 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
489
490
491 68/push "F - test-convert-passes-most-words-through"/imm32
492 68/push "== abcd 0x1 \n"/imm32
493 68/push _test-output-stream/imm32
494
495 e8/call check-stream-equal/disp32
496
497 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
498
499 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
500 5d/pop-to-EBP
501 c3/return
502
503 test-convert-direct-mode:
504
505 55/push-EBP
506 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
507
508
509
510 68/push _test-input-stream/imm32
511
512 e8/call clear-stream/disp32
513
514 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
515
516
517 b8/copy-to-EAX _test-input-buffered-file/imm32
518 05/add-to-EAX 4/imm32
519 50/push-EAX
520
521 e8/call clear-stream/disp32
522
523 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
524
525
526 68/push _test-output-stream/imm32
527
528 e8/call clear-stream/disp32
529
530 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
531
532
533 b8/copy-to-EAX _test-output-buffered-file/imm32
534 05/add-to-EAX 4/imm32
535 50/push-EAX
536
537 e8/call clear-stream/disp32
538
539 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
540
541
542
543 68/push "ab %ecx"/imm32
544 68/push _test-input-stream/imm32
545
546 e8/call write/disp32
547
548 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
549
550
551 68/push _test-output-buffered-file/imm32
552 68/push _test-input-buffered-file/imm32
553
554 e8/call convert/disp32
555
556 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
557
558
559
560 68/push _test-output-buffered-file/imm32
561
562 e8/call flush/disp32
563
564 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
565 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
591
592
593 68/push "F - test-convert-direct-mode"/imm32
594 68/push "ab 3/mod/direct 0x00000001/rm32 \n"/imm32
595 68/push _test-output-stream/imm32
596
597 e8/call check-stream-equal/disp32
598
599 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
600
601 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
602 5d/pop-to-EBP
603 c3/return
604
605 test-convert-register-indirect-mode:
606
607 55/push-EBP
608 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
609
610
611
612 68/push _test-input-stream/imm32
613
614 e8/call clear-stream/disp32
615
616 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
617
618
619 b8/copy-to-EAX _test-input-buffered-file/imm32
620 05/add-to-EAX 4/imm32
621 50/push-EAX
622
623 e8/call clear-stream/disp32
624
625 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
626
627
628 68/push _test-output-stream/imm32
629
630 e8/call clear-stream/disp32
631
632 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
633
634
635 b8/copy-to-EAX _test-output-buffered-file/imm32
636 05/add-to-EAX 4/imm32
637 50/push-EAX
638
639 e8/call clear-stream/disp32
640
641 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
642
643
644
645 68/push "ab *ecx"/imm32
646 68/push _test-input-stream/imm32
647
648 e8/call write/disp32
649
650 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
651
652
653 68/push _test-output-buffered-file/imm32
654 68/push _test-input-buffered-file/imm32
655
656 e8/call convert/disp32
657
658 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
659
660
661
662 68/push _test-output-buffered-file/imm32
663
664 e8/call flush/disp32
665
666 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
667 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
693
694
695 68/push "F - test-convert-indirect-mode"/imm32
696 68/push "ab 0/mod/indirect 0x00000001/rm32 \n"/imm32
697 68/push _test-output-stream/imm32
698
699 e8/call check-stream-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 test-convert-register-indirect-mode-without-displacement:
708
709 55/push-EBP
710 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
711
712
713
714 68/push _test-input-stream/imm32
715
716 e8/call clear-stream/disp32
717
718 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
719
720
721 b8/copy-to-EAX _test-input-buffered-file/imm32
722 05/add-to-EAX 4/imm32
723 50/push-EAX
724
725 e8/call clear-stream/disp32
726
727 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
728
729
730 68/push _test-output-stream/imm32
731
732 e8/call clear-stream/disp32
733
734 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
735
736
737 b8/copy-to-EAX _test-output-buffered-file/imm32
738 05/add-to-EAX 4/imm32
739 50/push-EAX
740
741 e8/call clear-stream/disp32
742
743 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
744
745
746
747 68/push "ab *(ecx)"/imm32
748 68/push _test-input-stream/imm32
749
750 e8/call write/disp32
751
752 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
753
754
755 68/push _test-output-buffered-file/imm32
756 68/push _test-input-buffered-file/imm32
757
758 e8/call convert/disp32
759
760 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
761
762
763
764 68/push _test-output-buffered-file/imm32
765
766 e8/call flush/disp32
767
768 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
769 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
795
796
797 68/push "F - test-convert-indirect-mode-without-displacement"/imm32
798 68/push "ab 0/mod/indirect 0x00000001/rm32 \n"/imm32
799 68/push _test-output-stream/imm32
800
801 e8/call check-stream-equal/disp32
802
803 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
804
805 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
806 5d/pop-to-EBP
807 c3/return
808
809 test-convert-register-indirect-mode-with-displacement:
810
811 55/push-EBP
812 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
813
814
815
816 68/push _test-input-stream/imm32
817
818 e8/call clear-stream/disp32
819
820 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
821
822
823 b8/copy-to-EAX _test-input-buffered-file/imm32
824 05/add-to-EAX 4/imm32
825 50/push-EAX
826
827 e8/call clear-stream/disp32
828
829 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
830
831
832 68/push _test-output-stream/imm32
833
834 e8/call clear-stream/disp32
835
836 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
837
838
839 b8/copy-to-EAX _test-output-buffered-file/imm32
840 05/add-to-EAX 4/imm32
841 50/push-EAX
842
843 e8/call clear-stream/disp32
844
845 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
846
847
848
849 68/push "ab *(ecx+4)"/imm32
850 68/push _test-input-stream/imm32
851
852 e8/call write/disp32
853
854 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
855
856
857 68/push _test-output-buffered-file/imm32
858 68/push _test-input-buffered-file/imm32
859
860 e8/call convert/disp32
861
862 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
863
864
865
866 68/push _test-output-buffered-file/imm32
867
868 e8/call flush/disp32
869
870 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
871 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
897
898
899 68/push "F - test-convert-indirect-mode-with-displacement"/imm32
900 68/push "ab 2/mod/*+disp32 0x00000001/rm32 0x00000004/disp32 \n"/imm32
901 68/push _test-output-stream/imm32
902
903 e8/call check-stream-equal/disp32
904
905 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
906
907 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
908 5d/pop-to-EBP
909 c3/return
910
911
912 test-convert-register-indirect-mode-with-sib-byte:
913
914 55/push-EBP
915 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
916
917
918
919 68/push _test-input-stream/imm32
920
921 e8/call clear-stream/disp32
922
923 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
924
925
926 b8/copy-to-EAX _test-input-buffered-file/imm32
927 05/add-to-EAX 4/imm32
928 50/push-EAX
929
930 e8/call clear-stream/disp32
931
932 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
933
934
935 68/push _test-output-stream/imm32
936
937 e8/call clear-stream/disp32
938
939 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
940
941
942 b8/copy-to-EAX _test-output-buffered-file/imm32
943 05/add-to-EAX 4/imm32
944 50/push-EAX
945
946 e8/call clear-stream/disp32
947
948 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
949
950
951
952 68/push "ab *(ecx + edx<<3 + 4)"/imm32
953 68/push _test-input-stream/imm32
954
955 e8/call write/disp32
956
957 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
958
959
960 68/push _test-output-buffered-file/imm32
961 68/push _test-input-buffered-file/imm32
962
963 e8/call convert/disp32
964
965 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
966
967
968
969 68/push _test-output-buffered-file/imm32
970
971 e8/call flush/disp32
972
973 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
974 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
1000
1001
1002 68/push "F - test-convert-indirect-mode-with-sib-byte"/imm32
1003 68/push "ab 2/mod/*+disp32 4/rm32/sib 0x00000001/base 0x00000002/index 0x00000003/scale 0x00000004/disp32 \n"/imm32
1004 68/push _test-output-stream/imm32
1005
1006 e8/call check-stream-equal/disp32
1007
1008 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1009
1010 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1011 5d/pop-to-EBP
1012 c3/return
1013
1014 test-convert-register-indirect-mode-with-sib-byte-negative-displacement:
1015
1016 55/push-EBP
1017 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1018
1019
1020
1021 68/push _test-input-stream/imm32
1022
1023 e8/call clear-stream/disp32
1024
1025 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1026
1027
1028 b8/copy-to-EAX _test-input-buffered-file/imm32
1029 05/add-to-EAX 4/imm32
1030 50/push-EAX
1031
1032 e8/call clear-stream/disp32
1033
1034 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1035
1036
1037 68/push _test-output-stream/imm32
1038
1039 e8/call clear-stream/disp32
1040
1041 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1042
1043
1044 b8/copy-to-EAX _test-output-buffered-file/imm32
1045 05/add-to-EAX 4/imm32
1046 50/push-EAX
1047
1048 e8/call clear-stream/disp32
1049
1050 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1051
1052
1053
1054 68/push "ab *(ecx + edx<<3 - 4)"/imm32
1055 68/push _test-input-stream/imm32
1056
1057 e8/call write/disp32
1058
1059 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1060
1061
1062 68/push _test-output-buffered-file/imm32
1063 68/push _test-input-buffered-file/imm32
1064
1065 e8/call convert/disp32
1066
1067 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1068
1069
1070
1071 68/push _test-output-buffered-file/imm32
1072
1073 e8/call flush/disp32
1074
1075 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1076 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
1102
1103
1104 68/push "F - test-convert-indirect-mode-with-sib-byte-negative-displacement"/imm32
1105 68/push "ab 2/mod/*+disp32 4/rm32/sib 0x00000001/base 0x00000002/index 0x00000003/scale 0xfffffffc/disp32 \n"/imm32
1106 68/push _test-output-stream/imm32
1107
1108 e8/call check-stream-equal/disp32
1109
1110 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1111
1112 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1113 5d/pop-to-EBP
1114 c3/return
1115
1116
1117 emit-direct-mode:
1118
1119 55/push-EBP
1120 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1121
1122 50/push-EAX
1123
1124
1125 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 0/r32/EAX 8/disp8 .
1126
1127 ff 0/subop/increment 0/mod/indirect 0/rm32/EAX . . . . . .
1128
1129
1130 68/push "Registers"/imm32
1131 68/push 8/imm32/row-size
1132 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1133 68/push Registers/imm32
1134
1135 e8/call get-slice/disp32
1136
1137 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
1138
1139
1140 68/push "3/mod/direct "/imm32
1141 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1142
1143 e8/call write-buffered/disp32
1144
1145 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1146
1147
1148 ff 6/subop/push 0/mod/indirect 0/rm32/EAX . . . . . .
1149 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1150
1151 e8/call print-int32-buffered/disp32
1152
1153 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1154
1155
1156 68/push "/rm32"/imm32
1157 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
1158
1159 e8/call write-buffered/disp32
1160
1161 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1162 $emit-direct-mode:end:
1163
1164 58/pop-to-EAX
1165
1166 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1167 5d/pop-to-EBP
1168 c3/return
1169
1170 test-emit-direct-mode:
1171
1172 55/push-EBP
1173 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1174
1175
1176
1177 68/push _test-output-stream/imm32
1178
1179 e8/call clear-stream/disp32
1180
1181 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1182
1183
1184 b8/copy-to-EAX _test-output-buffered-file/imm32
1185 05/add-to-EAX 4/imm32
1186 50/push-EAX
1187
1188 e8/call clear-stream/disp32
1189
1190 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1191
1192 b8/copy-to-EAX "%eax"/imm32
1193 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1194 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1195 05/add-to-EAX 4/imm32
1196
1197 51/push-ECX
1198 50/push-EAX
1199 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1200
1201
1202 68/push _test-output-buffered-file/imm32
1203 51/push-ECX
1204
1205 e8/call emit-direct-mode/disp32
1206
1207 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1208
1209
1210 68/push _test-output-buffered-file/imm32
1211
1212 e8/call flush/disp32
1213
1214 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1215 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1241
1242
1243 68/push "F - test-emit-direct-mode/0"/imm32
1244 68/push "3/mod/direct 0x00000000/rm32"/imm32
1245 68/push _test-output-stream/imm32
1246
1247 e8/call check-stream-equal/disp32
1248
1249 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1250
1251 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1252 5d/pop-to-EBP
1253 c3/return
1254
1255 test-emit-direct-mode-2:
1256
1257 55/push-EBP
1258 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1259
1260
1261
1262 68/push _test-output-stream/imm32
1263
1264 e8/call clear-stream/disp32
1265
1266 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1267
1268
1269 b8/copy-to-EAX _test-output-buffered-file/imm32
1270 05/add-to-EAX 4/imm32
1271 50/push-EAX
1272
1273 e8/call clear-stream/disp32
1274
1275 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1276
1277 b8/copy-to-EAX "%edi"/imm32
1278 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
1279 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
1280 05/add-to-EAX 4/imm32
1281
1282 51/push-ECX
1283 50/push-EAX
1284 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1285
1286
1287 68/push _test-output-buffered-file/imm32
1288 51/push-ECX
1289
1290 e8/call emit-direct-mode/disp32
1291
1292 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1293
1294
1295 68/push _test-output-buffered-file/imm32
1296
1297 e8/call flush/disp32
1298
1299 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1300 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1326
1327
1328 68/push "F - test-emit-direct-mode/1"/imm32
1329 68/push "3/mod/direct 0x00000007/rm32"/imm32
1330 68/push _test-output-stream/imm32
1331
1332 e8/call check-stream-equal/disp32
1333
1334 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1335
1336 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1337 5d/pop-to-EBP
1338 c3/return
1339
1340
1341
1342
1343
1344
1345
1346 next-word-or-expression:
1347
1348 55/push-EBP
1349 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1350
1351 50/push-EAX
1352 51/push-ECX
1353 56/push-ESI
1354 57/push-EDI
1355
1356 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
1357
1358 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 7/r32/EDI 0xc/disp8 .
1359
1360
1361 68/push 0x20/imm32/space
1362 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1363
1364 e8/call skip-chars-matching/disp32
1365
1366 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1367 $next-word-or-expression:check0:
1368
1369
1370 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
1371
1372 3b/compare 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
1373 7c/jump-if-lesser $next-word-or-expression:check-for-comment/disp8
1374
1375 c7 0/subop/copy 0/mod/direct 7/rm32/EDI . . . . . 0/imm32
1376 c7 0/subop/copy 1/mod/*+disp8 7/rm32/EDI . . . . 4/disp8 0/imm32
1377 e9/jump $next-word-or-expression:end/disp32
1378 $next-word-or-expression:check-for-comment:
1379
1380 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
1381 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
1382 89/copy 0/mod/indirect 7/rm32/EDI . . . 0/r32/EAX . .
1383
1384
1385 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1386 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
1387
1388 3d/compare-EAX-and 0x23/imm32/pound
1389 75/jump-if-not-equal $next-word-or-expression:check-for-string-literal/disp8
1390 $next-word-or-expression:comment:
1391
1392 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
1393 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 0/index/EAX . 0/r32/EAX 0xc/disp8 .
1394 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
1395
1396 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
1397 89/copy 1/mod/*+disp8 6/rm32/ESI . . . 0/r32/EAX 4/disp8 .
1398
1399 eb/jump $next-word-or-expression:end/disp8
1400 $next-word-or-expression:check-for-string-literal:
1401
1402
1403 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1404 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
1405
1406 3d/compare-EAX-and 0x22/imm32/dquote
1407 75/jump-if-not-equal $next-word-or-expression:check-for-paren/disp8
1408 $next-word-or-expression:string-literal:
1409
1410
1411 56/push-ESI
1412
1413 e8/call skip-string/disp32
1414
1415 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1416
1417 eb/jump $next-word-or-expression:regular-word/disp8
1418 $next-word-or-expression:check-for-paren:
1419
1420
1421 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
1422 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
1423
1424 3d/compare-EAX-and 0x2a/imm32/asterisk
1425 75/jump-if-not-equal $next-word-or-expression:regular-word/disp8
1426
1427 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xd/disp8 .
1428
1429 3d/compare-EAX-and 0x20/imm32/space
1430 74/jump-if-equal $next-word-or-expression:error1/disp8
1431
1432 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xd/disp8 .
1433
1434 3d/compare-EAX-and 0x28/imm32/open-paren
1435 75/jump-if-not-equal $next-word-or-expression:regular-word/disp8
1436 $next-word-or-expression:paren:
1437
1438
1439 56/push-ESI
1440
1441 e8/call skip-until-close-paren/disp32
1442
1443 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1444
1445 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
1446 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/AL 0xc/disp8 .
1447
1448 3d/compare-EAX-and 0x29/imm32/close-paren
1449 75/jump-if-not-equal $next-word-or-expression:error2/disp8
1450
1451 ff 0/subop/increment 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
1452
1453 $next-word-or-expression:regular-word:
1454
1455
1456 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
1457
1458 e8/call skip-chars-not-matching-whitespace/disp32
1459
1460 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1461
1462 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 1/r32/ECX 4/disp8 .
1463 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/ESI 1/index/ECX . 0/r32/EAX 0xc/disp8 .
1464 89/copy 1/mod/*+disp8 7/rm32/EDI . . . 0/r32/EAX 4/disp8 .
1465 $next-word-or-expression:end:
1466
1467 5f/pop-to-EDI
1468 5e/pop-to-ESI
1469 59/pop-to-ECX
1470 58/pop-to-EAX
1471
1472 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1473 5d/pop-to-EBP
1474 c3/return
1475
1476 $next-word-or-expression:error1:
1477
1478
1479
1480 68/push "error: no space allowed after '*' in '"/imm32
1481 68/push Stderr/imm32
1482
1483 e8/call write-buffered/disp32
1484
1485 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1486
1487
1488 56/push-ESI
1489 68/push Stderr/imm32
1490
1491 e8/call write-stream-data/disp32
1492
1493 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1494
1495
1496 68/push "'"/imm32
1497 68/push Stderr/imm32
1498
1499 e8/call write-buffered/disp32
1500
1501 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1502
1503
1504 68/push Stderr/imm32
1505
1506 e8/call flush/disp32
1507
1508 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1509
1510 bb/copy-to-EBX 1/imm32
1511 b8/copy-to-EAX 1/imm32/exit
1512 cd/syscall 0x80/imm8
1513
1514
1515 $next-word-or-expression:error2:
1516
1517
1518
1519 68/push "error: *(...) expression must be all on a single line in '"/imm32
1520 68/push Stderr/imm32
1521
1522 e8/call write-buffered/disp32
1523
1524 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1525
1526
1527 56/push-ESI
1528 68/push Stderr/imm32
1529
1530 e8/call write-stream-data/disp32
1531
1532 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1533
1534
1535 68/push "'"/imm32
1536 68/push Stderr/imm32
1537
1538 e8/call write-buffered/disp32
1539
1540 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1541
1542
1543 68/push Stderr/imm32
1544
1545 e8/call flush/disp32
1546
1547 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1548
1549 bb/copy-to-EBX 1/imm32
1550 b8/copy-to-EAX 1/imm32/exit
1551 cd/syscall 0x80/imm8
1552
1553
1554 test-next-word-or-expression:
1555
1556 55/push-EBP
1557 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1558
1559
1560
1561 68/push _test-input-stream/imm32
1562
1563 e8/call clear-stream/disp32
1564
1565 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1566
1567 68/push 0/imm32/end
1568 68/push 0/imm32/start
1569 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1570
1571
1572 68/push " ab"/imm32
1573 68/push _test-input-stream/imm32
1574
1575 e8/call write/disp32
1576
1577 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1578
1579
1580 51/push-ECX
1581 68/push _test-input-stream/imm32
1582
1583 e8/call next-word-or-expression/disp32
1584
1585 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1586
1587
1588 68/push "F - test-next-word-or-expression/updates-stream-read-correctly"/imm32
1589 68/push 4/imm32
1590 b8/copy-to-EAX _test-input-stream/imm32
1591 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
1592
1593 e8/call check-ints-equal/disp32
1594
1595 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1596
1597
1598
1599 68/push "F - test-next-word-or-expression: start"/imm32
1600 68/push 0xe/imm32
1601
1602 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1603 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1604 50/push-EAX
1605
1606 e8/call check-ints-equal/disp32
1607
1608 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1609
1610
1611
1612 68/push "F - test-next-word-or-expression: end"/imm32
1613 68/push 0x10/imm32
1614
1615 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1616 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1617 50/push-EAX
1618
1619 e8/call check-ints-equal/disp32
1620
1621 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1622
1623 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1624 5d/pop-to-EBP
1625 c3/return
1626
1627 test-next-word-or-expression-returns-whole-comment:
1628
1629 55/push-EBP
1630 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1631
1632
1633
1634 68/push _test-input-stream/imm32
1635
1636 e8/call clear-stream/disp32
1637
1638 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1639
1640 68/push 0/imm32/end
1641 68/push 0/imm32/start
1642 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1643
1644
1645 68/push " # a"/imm32
1646 68/push _test-input-stream/imm32
1647
1648 e8/call write/disp32
1649
1650 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1651
1652
1653 51/push-ECX
1654 68/push _test-input-stream/imm32
1655
1656 e8/call next-word-or-expression/disp32
1657
1658 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1659
1660
1661 68/push "F - test-next-word-or-expression-returns-whole-comment/updates-stream-read-correctly"/imm32
1662 68/push 5/imm32
1663 b8/copy-to-EAX _test-input-stream/imm32
1664 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
1665
1666 e8/call check-ints-equal/disp32
1667
1668 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1669
1670
1671
1672 68/push "F - test-next-word-or-expression-returns-whole-comment: start"/imm32
1673 68/push 0xe/imm32
1674
1675 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1676 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1677 50/push-EAX
1678
1679 e8/call check-ints-equal/disp32
1680
1681 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1682
1683
1684
1685 68/push "F - test-next-word-or-expression-returns-whole-comment: end"/imm32
1686 68/push 0x11/imm32
1687
1688 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1689 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1690 50/push-EAX
1691
1692 e8/call check-ints-equal/disp32
1693
1694 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1695
1696 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1697 5d/pop-to-EBP
1698 c3/return
1699
1700 test-next-word-or-expression-returns-empty-slice-on-eof:
1701
1702 55/push-EBP
1703 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1704
1705
1706
1707 68/push _test-input-stream/imm32
1708
1709 e8/call clear-stream/disp32
1710
1711 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1712
1713 68/push 0/imm32/end
1714 68/push 0/imm32/start
1715 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1716
1717
1718
1719 51/push-ECX
1720 68/push _test-input-stream/imm32
1721
1722 e8/call next-word-or-expression/disp32
1723
1724 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1725
1726
1727 68/push "F - test-next-word-or-expression-returns-empty-expression-on-eof"/imm32
1728 68/push 0/imm32
1729
1730 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1731 2b/subtract 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1732 50/push-EAX
1733
1734 e8/call check-ints-equal/disp32
1735
1736 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1737
1738 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1739 5d/pop-to-EBP
1740 c3/return
1741
1742 test-next-word-or-expression-returns-string-literal:
1743
1744 55/push-EBP
1745 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1746
1747
1748
1749 68/push _test-input-stream/imm32
1750
1751 e8/call clear-stream/disp32
1752
1753 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1754
1755 68/push 0/imm32/end
1756 68/push 0/imm32/start
1757 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1758
1759
1760 68/push " \"a b\"/imm32 "/imm32
1761 68/push _test-input-stream/imm32
1762
1763 e8/call write/disp32
1764
1765 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1766
1767
1768 51/push-ECX
1769 68/push _test-input-stream/imm32
1770
1771 e8/call next-word-or-expression/disp32
1772
1773 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1774
1775
1776
1777 68/push "F - test-next-word-or-expression-returns-string-literal: start"/imm32
1778 68/push 0xd/imm32
1779
1780 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1781 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1782 50/push-EAX
1783
1784 e8/call check-ints-equal/disp32
1785
1786 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1787
1788
1789
1790 68/push "F - test-next-word-or-expression-returns-string-literal: end"/imm32
1791 68/push 0x18/imm32
1792
1793 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1794 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1795 50/push-EAX
1796
1797 e8/call check-ints-equal/disp32
1798
1799 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1800
1801 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1802 5d/pop-to-EBP
1803 c3/return
1804
1805 test-next-word-or-expression-returns-string-with-escapes:
1806
1807 55/push-EBP
1808 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1809
1810
1811
1812 68/push _test-input-stream/imm32
1813
1814 e8/call clear-stream/disp32
1815
1816 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1817
1818 68/push 0/imm32/end
1819 68/push 0/imm32/start
1820 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1821
1822
1823 68/push " \"a\\\"b\"/x"/imm32
1824 68/push _test-input-stream/imm32
1825
1826 e8/call write/disp32
1827
1828 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1829
1830
1831 51/push-ECX
1832 68/push _test-input-stream/imm32
1833
1834 e8/call next-word-or-expression/disp32
1835
1836 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1837
1838
1839
1840 68/push "F - test-next-word-or-expression-returns-string-with-escapes: start"/imm32
1841 68/push 0xd/imm32
1842
1843 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1844 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1845 50/push-EAX
1846
1847 e8/call check-ints-equal/disp32
1848
1849 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1850
1851
1852
1853 68/push "F - test-next-word-or-expression-returns-string-with-escapes: end"/imm32
1854 68/push 0x15/imm32
1855
1856 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1857 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1858 50/push-EAX
1859
1860 e8/call check-ints-equal/disp32
1861
1862 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1863
1864 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1865 5d/pop-to-EBP
1866 c3/return
1867
1868 test-next-word-or-expression-returns-whole-expression:
1869
1870 55/push-EBP
1871 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1872
1873
1874
1875 68/push _test-input-stream/imm32
1876
1877 e8/call clear-stream/disp32
1878
1879 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
1880
1881 68/push 0/imm32/end
1882 68/push 0/imm32/start
1883 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
1884
1885
1886 68/push " *(a b)/imm32 "/imm32
1887 68/push _test-input-stream/imm32
1888
1889 e8/call write/disp32
1890
1891 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1892
1893
1894 51/push-ECX
1895 68/push _test-input-stream/imm32
1896
1897 e8/call next-word-or-expression/disp32
1898
1899 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
1900
1901
1902
1903 68/push "F - test-next-word-or-expression-returns-whole-expression: start"/imm32
1904 68/push 0xd/imm32
1905
1906 8b/copy 0/mod/indirect 1/rm32/ECX . . . 0/r32/EAX . .
1907 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1908 50/push-EAX
1909
1910 e8/call check-ints-equal/disp32
1911
1912 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1913
1914
1915
1916 68/push "F - test-next-word-or-expression-returns-whole-expression: end"/imm32
1917 68/push 0x19/imm32
1918
1919 8b/copy 1/mod/*+disp8 1/rm32/ECX . . . 0/r32/EAX 4/disp8 .
1920 81 5/subop/subtract 3/mod/direct 0/rm32/EAX . . . . . _test-input-stream/imm32
1921 50/push-EAX
1922
1923 e8/call check-ints-equal/disp32
1924
1925 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
1926
1927 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
1928 5d/pop-to-EBP
1929 c3/return
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940 parse-effective-address:
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976 55/push-EBP
1977 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
1978
1979 56/push-ESI
1980 57/push-EDI
1981
1982 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
1983
1984 ff 0/subop/increment 0/mod/indirect 6/rm32/ESI . . . . . .
1985
1986
1987 bf/copy-to-EDI 0/imm32
1988 b9/copy-to-ECX 4/imm32/no-index
1989 ba/copy-to-EDX 0/imm32/.scale
1990 bb/copy-to-EBX 0/imm32/disp
1991 $parse-effective-address:check-for-simple-register:
1992
1993 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
1994 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . .
1995 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32
1996 3d/compare-EAX-and 0x28/imm32/open-paren
1997 74/jump-if-equal $parse-effective-address:compound-expression/disp8
1998 $parse-effective-address:simple-register:
1999
2000
2001
2002 68/push "Registers"/imm32
2003 68/push 8/imm32/row-size
2004 56/push-ESI
2005 68/push Registers/imm32
2006
2007 e8/call get-slice/disp32
2008
2009 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2010
2011 8b/copy 0/mod/indirect 0/rm32/EAX . . . 7/r32/EDI . .
2012
2013 e9/jump $parse-effective-address:end/disp32
2014 $parse-effective-address:compound-expression:
2015
2016 ff 0/subop/increment 0/mod/indirect 6/rm32/ESI . . . . . .
2017
2018
2019
2020 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
2021 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
2022
2023 e8/call skip-chars-matching-whitespace-in-slice/disp32
2024
2025 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2026
2027 89/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2028
2029
2030
2031 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2032
2033 e8/call next-register/disp32
2034
2035 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2036
2037 8b/copy 0/mod/indirect 0/rm32/EAX . . . 7/r32/EDI . .
2038
2039
2040
2041 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
2042 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
2043
2044 e8/call skip-chars-matching-whitespace-in-slice/disp32
2045
2046 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2047
2048 89/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2049
2050 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . .
2051 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32
2052 3d/compare-EAX-and 0x29/imm32/close-paren
2053 0f 84/jump-if-equal $parse-effective-address:end/disp32
2054
2055 3d/compare-EAX-and 0x2d/imm32/minus
2056 0f 84/jump-if-equal $parse-effective-address:displacement/disp32
2057
2058 3d/compare-EAX-and 0x2b/imm32/plus
2059 0f 85/jump-if-not-equal $parse-effective-address:error1/disp32
2060 $parse-effective-address:check-for-index:
2061
2062 ff 0/subop/increment 0/mod/indirect 6/rm32/ESI . . . . . .
2063
2064
2065
2066 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
2067 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
2068
2069 e8/call skip-chars-matching-whitespace-in-slice/disp32
2070
2071 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2072
2073 89/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2074 $parse-effective-address:resolve-ambiguity:
2075
2076
2077 51/push-ECX
2078
2079
2080 89/copy 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
2081
2082 05/add-to-EAX 3/imm32
2083
2084 50/push-EAX
2085 51/push-ECX
2086
2087 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2088
2089
2090 68/push 8/imm32/row-size
2091 51/push-ECX
2092 68/push Registers/imm32
2093
2094 e8/call maybe-get-slice/disp32
2095
2096 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2097
2098 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2099
2100 59/pop-to-ECX
2101
2102 3d/compare-EAX-and 0/imm32
2103 0f 84/jump-if-equal $parse-effective-address:displacement/disp32
2104 $parse-effective-address:index:
2105
2106
2107
2108 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2109
2110 e8/call next-register/disp32
2111
2112 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2113
2114 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2115
2116
2117
2118 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
2119 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
2120
2121 e8/call skip-chars-matching-whitespace-in-slice/disp32
2122
2123 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2124
2125 89/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2126
2127 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . .
2128 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32
2129 3d/compare-EAX-and 0x29/imm32/close-paren
2130 0f 84/jump-if-equal $parse-effective-address:end/disp32
2131 $parse-effective-address:check-for-scale:
2132
2133 3d/compare-EAX-and 0x3c/imm32/less-than
2134 75/jump-if-not-equal $parse-effective-address:check-for-displacement/disp8
2135
2136 ff 0/subop/increment 0/mod/indirect 6/rm32/ESI . . . . . .
2137
2138 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2139 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . .
2140 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32
2141 3d/compare-EAX-and 0x3c/imm32/less-than
2142 0f 85/jump-if-not-equal $parse-effective-address:error2/disp32
2143
2144 ff 0/subop/increment 0/mod/indirect 6/rm32/ESI . . . . . .
2145
2146
2147
2148 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
2149 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
2150
2151 e8/call skip-chars-matching-whitespace-in-slice/disp32
2152
2153 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2154
2155 89/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2156 $parse-effective-address:scale:
2157
2158
2159
2160 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2161
2162 e8/call next-positive-hex-int/disp32
2163
2164 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2165
2166 89/copy 3/mod/direct 2/rm32/EDX . . . 0/r32/EAX . .
2167
2168
2169
2170 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
2171 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
2172
2173 e8/call skip-chars-matching-whitespace-in-slice/disp32
2174
2175 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2176
2177 89/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2178
2179 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . .
2180 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32
2181 3d/compare-EAX-and 0x29/imm32/close-paren
2182 74/jump-if-equal $parse-effective-address:end/disp8
2183 $parse-effective-address:check-for-displacement:
2184
2185 3d/compare-EAX-and 0x2b/imm32/plus
2186 74/jump-if-equal $parse-effective-address:displacement/disp8
2187 3d/compare-EAX-and 0x2d/imm32/minus
2188 74/jump-if-equal $parse-effective-address:displacement/disp8
2189 e9/jump $parse-effective-address:error3/disp32
2190 $parse-effective-address:displacement:
2191
2192
2193
2194 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2195
2196 e8/call next-hex-int/disp32
2197
2198 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2199
2200 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . .
2201
2202
2203
2204 ff 6/subop/push 1/mod/*+disp8 6/rm32/ESI . . . . 4/disp8 .
2205 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
2206
2207 e8/call skip-chars-matching-whitespace-in-slice/disp32
2208
2209 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2210
2211 89/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2212
2213 8a/copy-byte 0/mod/indirect 0/rm32/EAX . . . 0/r32/AL . .
2214 81 4/subop/and 3/mod/direct 0/rm32/EAX . . . . . 0xff/imm32
2215 3d/compare-EAX-and 0x29/imm32/close-paren
2216 0f 85/jump-if-not-equal $parse-effective-address:error4/disp32
2217 $parse-effective-address:end:
2218
2219 89/copy 3/mod/direct 0/rm32/EAX . . . 7/r32/EDI . .
2220
2221 5f/pop-to-EDI
2222 5e/pop-to-ESI
2223
2224 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2225 5d/pop-to-EBP
2226 c3/return
2227
2228 $parse-effective-address:error1:
2229
2230
2231
2232 68/push "error: unexpected character: "/imm32
2233 68/push Stderr/imm32
2234
2235 e8/call write-buffered/disp32
2236
2237 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2238
2239
2240 50/push-EAX
2241 68/push Stderr/imm32
2242
2243 e8/call print-int32-buffered/disp32
2244
2245 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2246
2247
2248 68/push "\n"/imm32
2249 68/push Stderr/imm32
2250
2251 e8/call write-buffered/disp32
2252
2253 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2254
2255
2256 68/push Stderr/imm32
2257
2258 e8/call flush/disp32
2259
2260 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2261
2262 bb/copy-to-EBX 1/imm32
2263 b8/copy-to-EAX 1/imm32/exit
2264 cd/syscall 0x80/imm8
2265
2266
2267 $parse-effective-address:error2:
2268
2269
2270
2271 68/push "error: '<' can only be followed by '<' but got: "/imm32
2272 68/push Stderr/imm32
2273
2274 e8/call write-buffered/disp32
2275
2276 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2277
2278
2279 50/push-EAX
2280 68/push Stderr/imm32
2281
2282 e8/call print-int32-buffered/disp32
2283
2284 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2285
2286
2287 68/push "\n"/imm32
2288 68/push Stderr/imm32
2289
2290 e8/call write-buffered/disp32
2291
2292 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2293
2294
2295 68/push Stderr/imm32
2296
2297 e8/call flush/disp32
2298
2299 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2300
2301 bb/copy-to-EBX 1/imm32
2302 b8/copy-to-EAX 1/imm32/exit
2303 cd/syscall 0x80/imm8
2304
2305
2306 $parse-effective-address:error3:
2307
2308
2309
2310 68/push "error: unexpected character before displacement: "/imm32
2311 68/push Stderr/imm32
2312
2313 e8/call write-buffered/disp32
2314
2315 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2316
2317
2318 50/push-EAX
2319 68/push Stderr/imm32
2320
2321 e8/call print-int32-buffered/disp32
2322
2323 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2324
2325
2326 68/push "\n"/imm32
2327 68/push Stderr/imm32
2328
2329 e8/call write-buffered/disp32
2330
2331 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2332
2333
2334 68/push Stderr/imm32
2335
2336 e8/call flush/disp32
2337
2338 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2339
2340 bb/copy-to-EBX 1/imm32
2341 b8/copy-to-EAX 1/imm32/exit
2342 cd/syscall 0x80/imm8
2343
2344
2345 $parse-effective-address:error4:
2346
2347
2348
2349 68/push "error: unexpected character after displacement: "/imm32
2350 68/push Stderr/imm32
2351
2352 e8/call write-buffered/disp32
2353
2354 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2355
2356
2357 50/push-EAX
2358 68/push Stderr/imm32
2359
2360 e8/call print-int32-buffered/disp32
2361
2362 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2363
2364
2365 68/push "; expected ')' to wrap up\n"/imm32
2366 68/push Stderr/imm32
2367
2368 e8/call write-buffered/disp32
2369
2370 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2371
2372
2373 68/push Stderr/imm32
2374
2375 e8/call flush/disp32
2376
2377 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2378
2379 bb/copy-to-EBX 1/imm32
2380 b8/copy-to-EAX 1/imm32/exit
2381 cd/syscall 0x80/imm8
2382
2383
2384
2385
2386 next-register:
2387
2388 55/push-EBP
2389 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2390
2391 51/push-ECX
2392 56/push-ESI
2393
2394 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
2395
2396 8b/copy 0/mod/indirect 6/rm32/ESI . . . 0/r32/EAX . .
2397 05/add-to-EAX 3/imm32
2398 50/push-EAX
2399 ff 6/subop/push 0/mod/indirect 6/rm32/ESI . . . . . .
2400 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2401
2402 81 0/subop/add 0/mod/indirect 6/rm32/ESI . . . . . 3/imm32
2403
2404
2405 68/push "next-register"/imm32
2406 68/push 8/imm32/row-size
2407 51/push-ECX
2408 68/push Registers/imm32
2409
2410 e8/call get-slice/disp32
2411
2412 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x10/imm32
2413 $next-register:end:
2414
2415 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2416
2417 5e/pop-to-ESI
2418 59/pop-to-ECX
2419
2420 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2421 5d/pop-to-EBP
2422 c3/return
2423
2424 test-parse-effective-address-simple:
2425
2426 55/push-EBP
2427 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2428
2429 b8/copy-to-EAX "*esi"/imm32
2430 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2431 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2432 05/add-to-EAX 4/imm32
2433
2434 51/push-ECX
2435 50/push-EAX
2436 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2437
2438
2439 51/push-ECX
2440
2441 e8/call parse-effective-address/disp32
2442
2443 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2444
2445
2446
2447 68/push "F - test-parse-effective-address-simple/base"/imm32
2448 68/push 6/imm32/ESI
2449 50/push-EAX
2450
2451 e8/call check-ints-equal/disp32
2452
2453 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2454
2455
2456 68/push "F - test-parse-effective-address-simple/index"/imm32
2457 68/push 4/imm32/none
2458 51/push-ECX
2459
2460 e8/call check-ints-equal/disp32
2461
2462 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2463
2464
2465 68/push "F - test-parse-effective-address-simple/scale"/imm32
2466 68/push 0/imm32/none
2467 52/push-EDX
2468
2469 e8/call check-ints-equal/disp32
2470
2471 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2472
2473
2474 68/push "F - test-parse-effective-address-simple/displacement"/imm32
2475 68/push 0/imm32/none
2476 53/push-EBX
2477
2478 e8/call check-ints-equal/disp32
2479
2480 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2481
2482 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2483 5d/pop-to-EBP
2484 c3/return
2485
2486 test-parse-effective-address-base:
2487
2488 55/push-EBP
2489 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2490
2491 b8/copy-to-EAX "*(esi )"/imm32
2492 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2493 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2494 05/add-to-EAX 4/imm32
2495
2496 51/push-ECX
2497 50/push-EAX
2498 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2499
2500
2501 51/push-ECX
2502
2503 e8/call parse-effective-address/disp32
2504
2505 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2506
2507
2508
2509 68/push "F - test-parse-effective-address-base/base"/imm32
2510 68/push 6/imm32/ESI
2511 50/push-EAX
2512
2513 e8/call check-ints-equal/disp32
2514
2515 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2516
2517
2518 68/push "F - test-parse-effective-address-base/index"/imm32
2519 68/push 4/imm32/none
2520 51/push-ECX
2521
2522 e8/call check-ints-equal/disp32
2523
2524 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2525
2526
2527 68/push "F - test-parse-effective-address-base/scale"/imm32
2528 68/push 0/imm32/none
2529 52/push-EDX
2530
2531 e8/call check-ints-equal/disp32
2532
2533 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2534
2535
2536 68/push "F - test-parse-effective-address-base/displacement"/imm32
2537 68/push 0/imm32/none
2538 53/push-EBX
2539
2540 e8/call check-ints-equal/disp32
2541
2542 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2543
2544 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2545 5d/pop-to-EBP
2546 c3/return
2547
2548 test-parse-effective-address-base-displacement:
2549
2550 55/push-EBP
2551 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2552
2553 b8/copy-to-EAX "*(esi+3)"/imm32
2554 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2555 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2556 05/add-to-EAX 4/imm32
2557
2558 51/push-ECX
2559 50/push-EAX
2560 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2561
2562
2563 51/push-ECX
2564
2565 e8/call parse-effective-address/disp32
2566
2567 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2568
2569
2570
2571 68/push "F - test-parse-effective-address-base-displacement/base"/imm32
2572 68/push 6/imm32/ESI
2573 50/push-EAX
2574
2575 e8/call check-ints-equal/disp32
2576
2577 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2578
2579
2580 68/push "F - test-parse-effective-address-base-displacement/index"/imm32
2581 68/push 4/imm32/none
2582 51/push-ECX
2583
2584 e8/call check-ints-equal/disp32
2585
2586 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2587
2588
2589 68/push "F - test-parse-effective-address-base-displacement/scale"/imm32
2590 68/push 0/imm32/none
2591 52/push-EDX
2592
2593 e8/call check-ints-equal/disp32
2594
2595 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2596
2597
2598 68/push "F - test-parse-effective-address-base-displacement/displacement"/imm32
2599 68/push 3/imm32
2600 53/push-EBX
2601
2602 e8/call check-ints-equal/disp32
2603
2604 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2605
2606 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2607 5d/pop-to-EBP
2608 c3/return
2609
2610 test-parse-effective-address-base-negative-displacement:
2611
2612 55/push-EBP
2613 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2614
2615 b8/copy-to-EAX "*(esi-3)"/imm32
2616 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2617 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2618 05/add-to-EAX 4/imm32
2619
2620 51/push-ECX
2621 50/push-EAX
2622 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2623
2624
2625 51/push-ECX
2626
2627 e8/call parse-effective-address/disp32
2628
2629 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2630
2631
2632
2633 68/push "F - test-parse-effective-address-base-negative-displacement/base"/imm32
2634 68/push 6/imm32/ESI
2635 50/push-EAX
2636
2637 e8/call check-ints-equal/disp32
2638
2639 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2640
2641
2642 68/push "F - test-parse-effective-address-base-negative-displacement/index"/imm32
2643 68/push 4/imm32/none
2644 51/push-ECX
2645
2646 e8/call check-ints-equal/disp32
2647
2648 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2649
2650
2651 68/push "F - test-parse-effective-address-base-negative-displacement/scale"/imm32
2652 68/push 0/imm32/none
2653 52/push-EDX
2654
2655 e8/call check-ints-equal/disp32
2656
2657 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2658
2659
2660 68/push "F - test-parse-effective-address-base-negative-displacement/displacement"/imm32
2661 68/push -3/imm32
2662 53/push-EBX
2663
2664 e8/call check-ints-equal/disp32
2665
2666 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2667
2668 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2669 5d/pop-to-EBP
2670 c3/return
2671
2672 test-parse-effective-address-base-index:
2673
2674 55/push-EBP
2675 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2676
2677 b8/copy-to-EAX "*(esi+ecx)"/imm32
2678 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2679 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2680 05/add-to-EAX 4/imm32
2681
2682 51/push-ECX
2683 50/push-EAX
2684 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2685
2686
2687 51/push-ECX
2688
2689 e8/call parse-effective-address/disp32
2690
2691 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2692
2693
2694
2695 68/push "F - test-parse-effective-address-base-index/base"/imm32
2696 68/push 6/imm32/ESI
2697 50/push-EAX
2698
2699 e8/call check-ints-equal/disp32
2700
2701 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2702
2703
2704 68/push "F - test-parse-effective-address-base-index/index"/imm32
2705 68/push 1/imm32/none
2706 51/push-ECX
2707
2708 e8/call check-ints-equal/disp32
2709
2710 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2711
2712
2713 68/push "F - test-parse-effective-address-base-index/scale"/imm32
2714 68/push 0/imm32/none
2715 52/push-EDX
2716
2717 e8/call check-ints-equal/disp32
2718
2719 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2720
2721
2722 68/push "F - test-parse-effective-address-base-index/displacement"/imm32
2723 68/push 0/imm32
2724 53/push-EBX
2725
2726 e8/call check-ints-equal/disp32
2727
2728 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2729
2730 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2731 5d/pop-to-EBP
2732 c3/return
2733
2734 test-parse-effective-address-base-index-scale:
2735
2736 55/push-EBP
2737 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2738
2739 b8/copy-to-EAX "*(esi+ecx<<2)"/imm32
2740 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2741 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2742 05/add-to-EAX 4/imm32
2743
2744 51/push-ECX
2745 50/push-EAX
2746 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2747
2748
2749 51/push-ECX
2750
2751 e8/call parse-effective-address/disp32
2752
2753 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2754
2755
2756
2757 68/push "F - test-parse-effective-address-base-index-scale/base"/imm32
2758 68/push 6/imm32/ESI
2759 50/push-EAX
2760
2761 e8/call check-ints-equal/disp32
2762
2763 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2764
2765
2766 68/push "F - test-parse-effective-address-base-index-scale/index"/imm32
2767 68/push 1/imm32/none
2768 51/push-ECX
2769
2770 e8/call check-ints-equal/disp32
2771
2772 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2773
2774
2775 68/push "F - test-parse-effective-address-base-index-scale/scale"/imm32
2776 68/push 2/imm32
2777 52/push-EDX
2778
2779 e8/call check-ints-equal/disp32
2780
2781 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2782
2783
2784 68/push "F - test-parse-effective-address-base-index-scale/displacement"/imm32
2785 68/push 0/imm32
2786 53/push-EBX
2787
2788 e8/call check-ints-equal/disp32
2789
2790 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2791
2792 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2793 5d/pop-to-EBP
2794 c3/return
2795
2796 test-parse-effective-address-base-index-scale-displacement:
2797
2798 55/push-EBP
2799 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2800
2801 b8/copy-to-EAX "*(esi + ecx<<2 - 0x34)"/imm32
2802 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
2803 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
2804 05/add-to-EAX 4/imm32
2805
2806 51/push-ECX
2807 50/push-EAX
2808 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
2809
2810
2811 51/push-ECX
2812
2813 e8/call parse-effective-address/disp32
2814
2815 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
2816
2817
2818
2819 68/push "F - test-parse-effective-address-base-index-scale/base"/imm32
2820 68/push 6/imm32/ESI
2821 50/push-EAX
2822
2823 e8/call check-ints-equal/disp32
2824
2825 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2826
2827
2828 68/push "F - test-parse-effective-address-base-index-scale/index"/imm32
2829 68/push 1/imm32/none
2830 51/push-ECX
2831
2832 e8/call check-ints-equal/disp32
2833
2834 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2835
2836
2837 68/push "F - test-parse-effective-address-base-index-scale/scale"/imm32
2838 68/push 2/imm32
2839 52/push-EDX
2840
2841 e8/call check-ints-equal/disp32
2842
2843 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2844
2845
2846 68/push "F - test-parse-effective-address-base-index-scale/displacement"/imm32
2847 68/push -0x34/imm32
2848 53/push-EBX
2849
2850 e8/call check-ints-equal/disp32
2851
2852 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
2853
2854 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
2855 5d/pop-to-EBP
2856 c3/return
2857
2858
2859
2860
2861
2862 emit-indirect-mode:
2863
2864 55/push-EBP
2865 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
2866 $emit-indirect-mode:check-for-sib:
2867
2868 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 4/imm32
2869 0f 84/jump-if-equal $emit-indirect-mode:check-for-disp/disp32
2870 $emit-indirect-mode:emit-sib:
2871
2872
2873
2874 68/push "2/mod/*+disp32 4/rm32/sib "/imm32
2875 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2876
2877 e8/call write-buffered/disp32
2878
2879 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2880
2881
2882 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2883 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2884
2885 e8/call print-int32-buffered/disp32
2886
2887 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2888
2889
2890 68/push "/base "/imm32
2891 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2892
2893 e8/call write-buffered/disp32
2894
2895 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2896
2897
2898 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 .
2899 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2900
2901 e8/call print-int32-buffered/disp32
2902
2903 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2904
2905
2906 68/push "/index "/imm32
2907 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2908
2909 e8/call write-buffered/disp32
2910
2911 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2912
2913
2914 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x14/disp8 .
2915 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2916
2917 e8/call print-int32-buffered/disp32
2918
2919 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2920
2921
2922 68/push "/scale "/imm32
2923 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2924
2925 e8/call write-buffered/disp32
2926
2927 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2928
2929
2930 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x18/disp8 .
2931 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2932
2933 e8/call print-int32-buffered/disp32
2934
2935 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2936
2937
2938 68/push "/disp32"/imm32
2939 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2940
2941 e8/call write-buffered/disp32
2942
2943 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2944 e9/jump $emit-indirect-mode:end/disp32
2945 $emit-indirect-mode:check-for-disp:
2946
2947 81 7/subop/compare 1/mod/*+disp8 5/rm32/EBP . . . . 0x18/disp8 0/imm32
2948 74/jump-if-equal $emit-indirect-mode:emit-indirect/disp8
2949 $emit-indirect-mode:emit-disp:
2950
2951
2952
2953 68/push "2/mod/*+disp32 "/imm32
2954 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2955
2956 e8/call write-buffered/disp32
2957
2958 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2959
2960
2961 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
2962 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2963
2964 e8/call print-int32-buffered/disp32
2965
2966 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2967
2968
2969 68/push "/rm32 "/imm32
2970 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2971
2972 e8/call write-buffered/disp32
2973
2974 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2975
2976
2977 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x18/disp8 .
2978 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2979
2980 e8/call print-int32-buffered/disp32
2981
2982 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2983
2984
2985 68/push "/disp32"/imm32
2986 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2987
2988 e8/call write-buffered/disp32
2989
2990 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
2991 eb/jump $emit-indirect-mode:end/disp8
2992 $emit-indirect-mode:emit-indirect:
2993
2994
2995
2996 68/push "0/mod/indirect "/imm32
2997 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
2998
2999 e8/call write-buffered/disp32
3000
3001 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3002
3003
3004 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 .
3005 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3006
3007 e8/call print-int32-buffered/disp32
3008
3009 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3010
3011
3012 68/push "/rm32"/imm32
3013 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 .
3014
3015 e8/call write-buffered/disp32
3016
3017 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3018 $emit-indirect-mode:end:
3019
3020 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3021 5d/pop-to-EBP
3022 c3/return
3023
3024 test-emit-indirect-mode:
3025
3026 55/push-EBP
3027 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3028
3029
3030
3031 68/push _test-output-stream/imm32
3032
3033 e8/call clear-stream/disp32
3034
3035 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3036
3037
3038 b8/copy-to-EAX _test-output-buffered-file/imm32
3039 05/add-to-EAX 4/imm32
3040 50/push-EAX
3041
3042 e8/call clear-stream/disp32
3043
3044 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3045
3046
3047 68/push 0/imm32/.disp
3048 68/push 0/imm32/.scale
3049 68/push 4/imm32/.index/none
3050 68/push 0/imm32/.base
3051 68/push _test-output-buffered-file/imm32
3052
3053 e8/call emit-indirect-mode/disp32
3054
3055 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x14/imm32
3056
3057
3058 68/push _test-output-buffered-file/imm32
3059
3060 e8/call flush/disp32
3061
3062 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3063 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3089
3090
3091 68/push "F - test-emit-indirect-mode"/imm32
3092 68/push "0/mod/indirect 0x00000000/rm32"/imm32
3093 68/push _test-output-stream/imm32
3094
3095 e8/call check-stream-equal/disp32
3096
3097 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3098
3099 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3100 5d/pop-to-EBP
3101 c3/return
3102
3103 test-emit-indirect-mode-2:
3104
3105 55/push-EBP
3106 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3107
3108
3109
3110 68/push _test-output-stream/imm32
3111
3112 e8/call clear-stream/disp32
3113
3114 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3115
3116
3117 b8/copy-to-EAX _test-output-buffered-file/imm32
3118 05/add-to-EAX 4/imm32
3119 50/push-EAX
3120
3121 e8/call clear-stream/disp32
3122
3123 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3124
3125
3126 68/push 0/imm32/.disp
3127 68/push 0/imm32/.scale
3128 68/push 4/imm32/.index/none
3129 68/push 7/imm32/.base
3130 68/push _test-output-buffered-file/imm32
3131
3132 e8/call emit-indirect-mode/disp32
3133
3134 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x14/imm32
3135
3136
3137 68/push _test-output-buffered-file/imm32
3138
3139 e8/call flush/disp32
3140
3141 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3142 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3168
3169
3170 68/push "F - test-emit-indirect-mode-2"/imm32
3171 68/push "0/mod/indirect 0x00000007/rm32"/imm32
3172 68/push _test-output-stream/imm32
3173
3174 e8/call check-stream-equal/disp32
3175
3176 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3177
3178 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3179 5d/pop-to-EBP
3180 c3/return
3181
3182 test-emit-indirect-mode-with-disp:
3183
3184 55/push-EBP
3185 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3186
3187
3188
3189 68/push _test-output-stream/imm32
3190
3191 e8/call clear-stream/disp32
3192
3193 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3194
3195
3196 b8/copy-to-EAX _test-output-buffered-file/imm32
3197 05/add-to-EAX 4/imm32
3198 50/push-EAX
3199
3200 e8/call clear-stream/disp32
3201
3202 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3203
3204
3205 68/push 4/imm32/.disp
3206 68/push 0/imm32/.scale
3207 68/push 4/imm32/.index/none
3208 68/push 6/imm32/.base
3209 68/push _test-output-buffered-file/imm32
3210
3211 e8/call emit-indirect-mode/disp32
3212
3213 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x14/imm32
3214
3215
3216 68/push _test-output-buffered-file/imm32
3217
3218 e8/call flush/disp32
3219
3220 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3221 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3247
3248
3249 68/push "F - test-emit-indirect-mode-with-disp"/imm32
3250 68/push "2/mod/*+disp32 0x00000006/rm32 0x00000004/disp32"/imm32
3251 68/push _test-output-stream/imm32
3252
3253 e8/call check-stream-equal/disp32
3254
3255 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3256
3257 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3258 5d/pop-to-EBP
3259 c3/return
3260
3261 test-emit-indirect-mode-with-disp-negative:
3262
3263 55/push-EBP
3264 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3265
3266
3267
3268 68/push _test-output-stream/imm32
3269
3270 e8/call clear-stream/disp32
3271
3272 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3273
3274
3275 b8/copy-to-EAX _test-output-buffered-file/imm32
3276 05/add-to-EAX 4/imm32
3277 50/push-EAX
3278
3279 e8/call clear-stream/disp32
3280
3281 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3282
3283
3284 68/push -4/imm32/.disp
3285 68/push 0/imm32/.scale
3286 68/push 4/imm32/.index/none
3287 68/push 6/imm32/.base
3288 68/push _test-output-buffered-file/imm32
3289
3290 e8/call emit-indirect-mode/disp32
3291
3292 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x14/imm32
3293
3294
3295 68/push _test-output-buffered-file/imm32
3296
3297 e8/call flush/disp32
3298
3299 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3300 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3326
3327
3328 68/push "F - test-emit-indirect-mode-with-disp"/imm32
3329 68/push "2/mod/*+disp32 0x00000006/rm32 0xfffffffc/disp32"/imm32
3330 68/push _test-output-stream/imm32
3331
3332 e8/call check-stream-equal/disp32
3333
3334 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3335
3336 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3337 5d/pop-to-EBP
3338 c3/return
3339
3340 test-emit-indirect-mode-with-sib:
3341
3342 55/push-EBP
3343 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3344
3345
3346
3347 68/push _test-output-stream/imm32
3348
3349 e8/call clear-stream/disp32
3350
3351 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3352
3353
3354 b8/copy-to-EAX _test-output-buffered-file/imm32
3355 05/add-to-EAX 4/imm32
3356 50/push-EAX
3357
3358 e8/call clear-stream/disp32
3359
3360 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3361
3362
3363 68/push 4/imm32/.disp
3364 68/push 2/imm32/.scale
3365 68/push 1/imm32/.index
3366 68/push 6/imm32/.base
3367 68/push _test-output-buffered-file/imm32
3368
3369 e8/call emit-indirect-mode/disp32
3370
3371 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0x14/imm32
3372
3373
3374 68/push _test-output-buffered-file/imm32
3375
3376 e8/call flush/disp32
3377
3378 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3379 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3405
3406
3407 68/push "F - test-emit-indirect-mode-with-sib"/imm32
3408 68/push "2/mod/*+disp32 4/rm32/sib 0x00000006/base 0x00000001/index 0x00000002/scale 0x00000004/disp32"/imm32
3409 68/push _test-output-stream/imm32
3410
3411 e8/call check-stream-equal/disp32
3412
3413 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3414
3415 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3416 5d/pop-to-EBP
3417 c3/return
3418
3419
3420
3421 skip-until-close-paren:
3422
3423 55/push-EBP
3424 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3425
3426 50/push-EAX
3427 51/push-ECX
3428 52/push-EDX
3429
3430 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 1/r32/ECX 8/disp8 .
3431
3432
3433 8b/copy 1/mod/*+disp8 1/rm32/ECX . . 2/r32/EDX 8/disp8 .
3434 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 2/index/EDX . 2/r32/EDX 0xc/disp8 .
3435 52/push-EDX
3436
3437 8b/copy 1/mod/*+disp8 1/rm32/ECX . . 2/r32/EDX 4/disp8 .
3438 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ECX 2/index/EDX . 2/r32/EDX 0xc/disp8 .
3439 52/push-EDX
3440
3441 e8/call skip-until-close-paren-in-slice/disp32
3442
3443 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3444
3445 29/subtract 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
3446 2d/subtract-from-EAX 0xc/imm32
3447 89/copy 1/mod/*+disp8 1/rm32/ECX . . 0/r32/EAX 4/disp8 .
3448 $skip-until-close-paren:end:
3449
3450 5a/pop-to-EDX
3451 59/pop-to-ECX
3452 58/pop-to-EAX
3453
3454 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3455 5d/pop-to-EBP
3456 c3/return
3457
3458 test-skip-until-close-paren:
3459
3460 55/push-EBP
3461 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3462
3463
3464
3465 68/push _test-input-stream/imm32
3466
3467 e8/call clear-stream/disp32
3468
3469 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3470
3471
3472
3473 68/push "*(abc) def"/imm32
3474 68/push _test-input-stream/imm32
3475
3476 e8/call write/disp32
3477
3478 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3479
3480
3481 68/push "F - test-skip-until-close-paren/precondition"/imm32
3482 68/push 0/imm32
3483 b8/copy-to-EAX _test-input-stream/imm32
3484 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
3485
3486 e8/call check-ints-equal/disp32
3487
3488 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3489
3490
3491 68/push _test-input-stream/imm32
3492
3493 e8/call skip-until-close-paren/disp32
3494
3495 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3496
3497
3498 68/push "F - test-skip-until-close-paren"/imm32
3499 68/push 5/imm32
3500 b8/copy-to-EAX _test-input-stream/imm32
3501 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
3502
3503 e8/call check-ints-equal/disp32
3504
3505 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3506
3507 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3508 5d/pop-to-EBP
3509 c3/return
3510
3511 test-skip-until-close-paren-ignores-spaces:
3512
3513 55/push-EBP
3514 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3515
3516
3517
3518 68/push _test-input-stream/imm32
3519
3520 e8/call clear-stream/disp32
3521
3522 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3523
3524
3525 68/push "*(a b)/yz"/imm32
3526 68/push _test-input-stream/imm32
3527
3528 e8/call write/disp32
3529
3530 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3531
3532
3533 68/push "F - test-skip-until-close-paren-ignores-spaces/precondition"/imm32
3534 68/push 0/imm32
3535 b8/copy-to-EAX _test-input-stream/imm32
3536 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
3537
3538 e8/call check-ints-equal/disp32
3539
3540 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3541
3542
3543 68/push _test-input-stream/imm32
3544
3545 e8/call skip-until-close-paren/disp32
3546
3547 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3548
3549
3550 68/push "F - test-skip-until-close-paren-ignores-spaces"/imm32
3551 68/push 5/imm32
3552 b8/copy-to-EAX _test-input-stream/imm32
3553 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
3554
3555 e8/call check-ints-equal/disp32
3556
3557 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3558
3559 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3560 5d/pop-to-EBP
3561 c3/return
3562
3563 test-skip-until-close-paren-works-from-mid-stream:
3564
3565 55/push-EBP
3566 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3567
3568
3569
3570 68/push _test-input-stream/imm32
3571
3572 e8/call clear-stream/disp32
3573
3574 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3575
3576
3577 68/push "0 *(a b)/yz"/imm32
3578 68/push _test-input-stream/imm32
3579
3580 e8/call write/disp32
3581
3582 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3583
3584 c7 0/subop/copy 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 2/imm32
3585
3586
3587 68/push _test-input-stream/imm32
3588
3589 e8/call skip-until-close-paren/disp32
3590
3591 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3592
3593
3594 68/push "F - test-skip-until-close-paren-works-from-mid-stream"/imm32
3595 68/push 7/imm32
3596 b8/copy-to-EAX _test-input-stream/imm32
3597 ff 6/subop/push 1/mod/*+disp8 0/rm32/EAX . . . . 4/disp8 .
3598
3599 e8/call check-ints-equal/disp32
3600
3601 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3602
3603 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3604 5d/pop-to-EBP
3605 c3/return
3606
3607 skip-until-close-paren-in-slice:
3608
3609 55/push-EBP
3610 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3611
3612 51/push-ECX
3613 52/push-EDX
3614
3615 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 1/r32/ECX 8/disp8 .
3616
3617 8b/copy 1/mod/*+disp8 5/rm32/EBP . . 2/r32/EDX 0xc/disp8 .
3618
3619 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3620
3621 41/increment-ECX
3622 $skip-until-close-paren-in-slice:loop:
3623
3624 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
3625 73/jump-if-greater-unsigned-or-equal $skip-until-close-paren-in-slice:break/disp8
3626
3627 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
3628 $skip-until-close-paren-in-slice:check-close:
3629
3630 3d/compare-EAX-and 0x29/imm32/close-paren
3631 74/jump-if-equal $skip-until-close-paren-in-slice:break/disp8
3632
3633 41/increment-ECX
3634 eb/jump $skip-until-close-paren-in-slice:loop/disp8
3635 $skip-until-close-paren-in-slice:break:
3636
3637 89/copy 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . .
3638 $skip-until-close-paren-in-slice:end:
3639
3640 5a/pop-to-EDX
3641 59/pop-to-ECX
3642
3643 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3644 5d/pop-to-EBP
3645 c3/return
3646
3647 test-skip-until-close-paren-in-slice:
3648
3649 55/push-EBP
3650 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3651
3652 b8/copy-to-EAX "*(abc) def"/imm32
3653 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
3654 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
3655 05/add-to-EAX 4/imm32
3656
3657
3658 51/push-ECX
3659 50/push-EAX
3660
3661 e8/call skip-until-close-paren-in-slice/disp32
3662
3663 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3664
3665
3666 68/push "F - test-skip-until-close-paren-in-slice"/imm32
3667 68/push 5/imm32
3668
3669 29/subtract 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
3670 51/push-ECX
3671
3672 e8/call check-ints-equal/disp32
3673
3674 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3675
3676 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3677 5d/pop-to-EBP
3678 c3/return
3679
3680 test-skip-until-close-paren-in-slice-ignores-spaces:
3681
3682 55/push-EBP
3683 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3684
3685 b8/copy-to-EAX "*(a b)/yz"/imm32
3686 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
3687 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
3688 05/add-to-EAX 4/imm32
3689
3690
3691 51/push-ECX
3692 50/push-EAX
3693
3694 e8/call skip-until-close-paren-in-slice/disp32
3695
3696 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3697
3698
3699 68/push "F - test-skip-until-close-paren-in-slice-ignores-spaces"/imm32
3700 68/push 4/imm32
3701
3702 29/subtract 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
3703 51/push-ECX
3704
3705 e8/call check-ints-equal/disp32
3706
3707 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3708
3709 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3710 5d/pop-to-EBP
3711 c3/return
3712
3713 test-skip-until-close-paren-in-slice-stops-at-end:
3714
3715 55/push-EBP
3716 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3717
3718 b8/copy-to-EAX "*(abc"/imm32
3719 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
3720 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
3721 05/add-to-EAX 4/imm32
3722
3723
3724 51/push-ECX
3725 50/push-EAX
3726
3727 e8/call skip-until-close-paren-in-slice/disp32
3728
3729 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3730
3731
3732 68/push "F - test-skip-until-close-paren-in-slice-stops-at-end"/imm32
3733 68/push 0/imm32
3734
3735 29/subtract 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
3736 51/push-ECX
3737
3738 e8/call check-ints-equal/disp32
3739
3740 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3741
3742 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3743 5d/pop-to-EBP
3744 c3/return
3745
3746
3747
3748
3749 next-hex-int:
3750
3751 55/push-EBP
3752 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3753
3754 51/push-ECX
3755 52/push-EDX
3756 53/push-EBX
3757 56/push-ESI
3758 57/push-EDI
3759
3760 31/xor 3/mod/direct 7/rm32/EDI . . . 7/r32/EDI . .
3761
3762 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
3763
3764 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 .
3765
3766 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
3767
3768 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
3769
3770 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3771 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
3772 $next-hex-int:positive:
3773
3774 3d/compare-EAX-and 0x2b/imm32/+
3775 75/jump-if-not-equal $next-hex-int:negative/disp8
3776
3777 41/increment-ECX
3778 eb/jump $next-hex-int:skip-whitespace/disp8
3779 $next-hex-int:negative:
3780
3781 3d/compare-EAX-and 0x2d/imm32/-
3782 75/jump-if-not-equal $next-hex-int:skip-whitespace/disp8
3783 $next-hex-int:need-to-negate:
3784
3785 41/increment-ECX
3786
3787 bb/copy-to-EBX 1/imm32/true
3788
3789 $next-hex-int:skip-whitespace:
3790
3791 50/push-EAX
3792
3793
3794 52/push-EDX
3795 51/push-ECX
3796
3797 e8/call skip-chars-matching-whitespace-in-slice/disp32
3798
3799 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3800
3801 89/copy 3/mod/direct 1/rm32/ECX . . . 0/r32/EAX . .
3802
3803 58/pop-to-EAX
3804 $next-hex-int:initial-0:
3805
3806
3807 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
3808 3d/compare-EAX-and 0x30/imm32/0
3809 75/jump-if-not-equal $next-hex-int:loop/disp8
3810
3811 41/increment-ECX
3812 $next-hex-int:initial-0x:
3813
3814 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
3815 73/jump-if-greater-or-equal-unsigned $next-hex-int:end/disp8
3816
3817 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
3818 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
3819 3d/compare-EAX-and 0x78/imm32/x
3820 75/jump-if-not-equal $next-hex-int:loop/disp8
3821
3822 41/increment-ECX
3823 $next-hex-int:loop:
3824
3825 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
3826 73/jump-if-greater-or-equal-unsigned $next-hex-int:break/disp8
3827
3828
3829 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
3830
3831
3832 50/push-EAX
3833
3834 e8/call is-hex-digit?/disp32
3835
3836 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3837
3838 3d/compare-EAX-and 0/imm32
3839 74/jump-if-equal $next-hex-int:break/disp8
3840
3841
3842 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
3843
3844 e8/call from-hex-char/disp32
3845
3846 c1/shift 4/subop/left 3/mod/direct 7/rm32/EDI . . . . . 4/imm8
3847 01/add 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
3848
3849 41/increment-ECX
3850
3851 eb/jump $next-hex-int:loop/disp8
3852 $next-hex-int:break:
3853 81 7/subop/compare 3/mod/direct 3/rm32/EBX . . . . . 0/imm32
3854 74/jump-if-equal $next-hex-int:end/disp8
3855 $next-hex-int:negate:
3856 f7 3/subop/negate 3/mod/direct 7/rm32/EDI . . . . . .
3857 $next-hex-int:end:
3858
3859 89/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
3860
3861 89/copy 3/mod/direct 0/rm32/EAX . . . 7/r32/EDI . .
3862
3863 5f/pop-to-EDI
3864 5e/pop-to-ESI
3865 5b/pop-to-EBX
3866 5a/pop-to-EDX
3867 59/pop-to-ECX
3868
3869 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3870 5d/pop-to-EBP
3871 c3/return
3872
3873 $next-hex-int:abort:
3874
3875
3876 68/push "next-hex-int: invalid hex char: "/imm32
3877 68/push 2/imm32/stderr
3878
3879 e8/call _write/disp32
3880
3881 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3882
3883
3884 50/push-EAX
3885
3886 b8/copy-to-EAX Stderr/imm32
3887 05/add-to-EAX 4/imm32
3888 50/push-EAX
3889
3890 e8/call clear-stream/disp32
3891
3892 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3893
3894 58/pop-to-EAX
3895
3896
3897 50/push-EAX
3898 68/push Stderr/imm32
3899
3900 e8/call print-int32-buffered/disp32
3901
3902 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3903
3904
3905 68/push Stderr/imm32
3906
3907 e8/call flush/disp32
3908
3909 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3910
3911
3912 68/push "\n"/imm32
3913 68/push 2/imm32/stderr
3914
3915 e8/call _write/disp32
3916
3917 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32
3918
3919 bb/copy-to-EBX 1/imm32
3920 b8/copy-to-EAX 1/imm32/exit
3921 cd/syscall 0x80/imm8
3922
3923
3924 test-next-hex-int-single-digit:
3925
3926 55/push-EBP
3927 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3928
3929 b8/copy-to-EAX "+a)"/imm32
3930 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
3931 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
3932 05/add-to-EAX 4/imm32
3933
3934 51/push-ECX
3935 50/push-EAX
3936 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
3937
3938
3939 51/push-ECX
3940
3941 e8/call next-hex-int/disp32
3942
3943 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3944
3945
3946 68/push "F - test-next-hex-int-single-digit"/imm32
3947 68/push 0xa/imm32
3948 50/push-EAX
3949
3950 e8/call check-ints-equal/disp32
3951
3952 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3953
3954 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3955 5d/pop-to-EBP
3956 c3/return
3957
3958 test-next-hex-int-multi-digit:
3959
3960 55/push-EBP
3961 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3962
3963 b8/copy-to-EAX "+ 34a)"/imm32
3964 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
3965 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
3966 05/add-to-EAX 4/imm32
3967
3968 51/push-ECX
3969 50/push-EAX
3970 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
3971
3972
3973 51/push-ECX
3974
3975 e8/call next-hex-int/disp32
3976
3977 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
3978
3979
3980 68/push "F - test-next-hex-int-multi-digit"/imm32
3981 68/push 0x34a/imm32
3982 50/push-EAX
3983
3984 e8/call check-ints-equal/disp32
3985
3986 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
3987
3988 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
3989 5d/pop-to-EBP
3990 c3/return
3991
3992 test-next-hex-int-0x-prefix:
3993
3994 55/push-EBP
3995 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
3996
3997 b8/copy-to-EAX "+0x34)"/imm32
3998 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
3999 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4000 05/add-to-EAX 4/imm32
4001
4002 51/push-ECX
4003 50/push-EAX
4004 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4005
4006
4007 51/push-ECX
4008
4009 e8/call next-hex-int/disp32
4010
4011 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4012
4013
4014 68/push "F - test-next-hex-int-0x-prefix"/imm32
4015 68/push 0x34/imm32
4016 50/push-EAX
4017
4018 e8/call check-ints-equal/disp32
4019
4020 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4021
4022 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4023 5d/pop-to-EBP
4024 c3/return
4025
4026 test-next-hex-int-zero:
4027
4028 55/push-EBP
4029 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4030
4031 b8/copy-to-EAX "+0)"/imm32
4032 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4033 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4034 05/add-to-EAX 4/imm32
4035
4036 51/push-ECX
4037 50/push-EAX
4038 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4039
4040
4041 51/push-ECX
4042
4043 e8/call next-hex-int/disp32
4044
4045 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4046
4047
4048 68/push "F - test-next-hex-int-zero"/imm32
4049 68/push 0/imm32
4050 50/push-EAX
4051
4052 e8/call check-ints-equal/disp32
4053
4054 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4055
4056 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4057 5d/pop-to-EBP
4058 c3/return
4059
4060 test-next-hex-int-0-prefix:
4061
4062 55/push-EBP
4063 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4064
4065 b8/copy-to-EAX "+ 03)"/imm32
4066 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4067 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4068 05/add-to-EAX 4/imm32
4069
4070 51/push-ECX
4071 50/push-EAX
4072 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4073
4074
4075 51/push-ECX
4076
4077 e8/call next-hex-int/disp32
4078
4079 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4080
4081
4082 68/push "F - test-next-hex-int-0-prefix"/imm32
4083 68/push 3/imm32
4084 50/push-EAX
4085
4086 e8/call check-ints-equal/disp32
4087
4088 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4089
4090 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4091 5d/pop-to-EBP
4092 c3/return
4093
4094 test-next-hex-int-negative:
4095
4096 55/push-EBP
4097 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4098
4099 b8/copy-to-EAX "-03)"/imm32
4100 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4101 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4102 05/add-to-EAX 4/imm32
4103
4104 51/push-ECX
4105 50/push-EAX
4106 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4107
4108
4109 51/push-ECX
4110
4111 e8/call next-hex-int/disp32
4112
4113 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4114
4115
4116 68/push "F - test-next-hex-int-negative"/imm32
4117 68/push -3/imm32
4118 50/push-EAX
4119
4120 e8/call check-ints-equal/disp32
4121
4122 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4123
4124 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4125 5d/pop-to-EBP
4126 c3/return
4127
4128 test-next-hex-int-negative-with-space:
4129
4130 55/push-EBP
4131 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4132
4133 b8/copy-to-EAX "- 03)"/imm32
4134 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4135 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4136 05/add-to-EAX 4/imm32
4137
4138 51/push-ECX
4139 50/push-EAX
4140 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4141
4142
4143 51/push-ECX
4144
4145 e8/call next-hex-int/disp32
4146
4147 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4148
4149
4150 68/push "F - test-next-hex-int-negative-with-space"/imm32
4151 68/push -3/imm32
4152 50/push-EAX
4153
4154 e8/call check-ints-equal/disp32
4155
4156 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4157
4158 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4159 5d/pop-to-EBP
4160 c3/return
4161
4162
4163
4164
4165 next-positive-hex-int:
4166
4167 55/push-EBP
4168 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4169
4170 51/push-ECX
4171 52/push-EDX
4172 53/push-EBX
4173 56/push-ESI
4174 57/push-EDI
4175
4176 31/xor 3/mod/direct 7/rm32/EDI . . . 7/r32/EDI . .
4177
4178 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 .
4179
4180 8b/copy 1/mod/*+disp8 6/rm32/ESI . . . 2/r32/EDX 4/disp8 .
4181
4182 8b/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
4183
4184 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . .
4185
4186 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
4187 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
4188 $next-positive-hex-int:initial-0:
4189
4190
4191 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
4192 3d/compare-EAX-and 0x30/imm32/0
4193 75/jump-if-not-equal $next-positive-hex-int:loop/disp8
4194
4195 41/increment-ECX
4196 $next-positive-hex-int:initial-0x:
4197
4198 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
4199 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8
4200
4201 31/xor 3/mod/direct 0/rm32/EAX . . . 0/r32/EAX . .
4202 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
4203 3d/compare-EAX-and 0x78/imm32/x
4204 75/jump-if-not-equal $next-positive-hex-int:loop/disp8
4205
4206 41/increment-ECX
4207 $next-positive-hex-int:loop:
4208
4209 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . .
4210 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8
4211
4212
4213 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
4214
4215
4216 50/push-EAX
4217
4218 e8/call is-hex-digit?/disp32
4219
4220 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4221
4222 3d/compare-EAX-and 0/imm32
4223 74/jump-if-equal $next-positive-hex-int:end/disp8
4224
4225
4226 8a/copy-byte 0/mod/indirect 1/rm32/ECX . . . 0/r32/AL . .
4227
4228 e8/call from-hex-char/disp32
4229
4230 c1/shift 4/subop/left 3/mod/direct 7/rm32/EDI . . . . . 4/imm8
4231 01/add 3/mod/direct 7/rm32/EDI . . . 0/r32/EAX . .
4232
4233 41/increment-ECX
4234
4235 eb/jump $next-positive-hex-int:loop/disp8
4236 $next-positive-hex-int:end:
4237
4238 89/copy 0/mod/indirect 6/rm32/ESI . . . 1/r32/ECX . .
4239
4240 89/copy 3/mod/direct 0/rm32/EAX . . . 7/r32/EDI . .
4241
4242 5f/pop-to-EDI
4243 5e/pop-to-ESI
4244 5b/pop-to-EBX
4245 5a/pop-to-EDX
4246 59/pop-to-ECX
4247
4248 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4249 5d/pop-to-EBP
4250 c3/return
4251
4252 test-next-positive-hex-int-single-digit:
4253
4254 55/push-EBP
4255 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4256
4257 b8/copy-to-EAX "a)"/imm32
4258 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4259 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4260 05/add-to-EAX 4/imm32
4261
4262 51/push-ECX
4263 50/push-EAX
4264 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4265
4266
4267 51/push-ECX
4268
4269 e8/call next-positive-hex-int/disp32
4270
4271 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4272
4273
4274 68/push "F - test-next-positive-hex-int-single-digit"/imm32
4275 68/push 0xa/imm32
4276 50/push-EAX
4277
4278 e8/call check-ints-equal/disp32
4279
4280 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4281
4282 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4283 5d/pop-to-EBP
4284 c3/return
4285
4286 test-next-positive-hex-int-multi-digit:
4287
4288 55/push-EBP
4289 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4290
4291 b8/copy-to-EAX "34a)"/imm32
4292 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4293 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4294 05/add-to-EAX 4/imm32
4295
4296 51/push-ECX
4297 50/push-EAX
4298 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4299
4300
4301 51/push-ECX
4302
4303 e8/call next-positive-hex-int/disp32
4304
4305 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4306
4307
4308 68/push "F - test-next-positive-hex-int-multi-digit"/imm32
4309 68/push 0x34a/imm32
4310 50/push-EAX
4311
4312 e8/call check-ints-equal/disp32
4313
4314 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4315
4316 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4317 5d/pop-to-EBP
4318 c3/return
4319
4320 test-next-positive-hex-int-0x-prefix:
4321
4322 55/push-EBP
4323 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4324
4325 b8/copy-to-EAX "0x34)"/imm32
4326 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4327 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4328 05/add-to-EAX 4/imm32
4329
4330 51/push-ECX
4331 50/push-EAX
4332 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4333
4334
4335 51/push-ECX
4336
4337 e8/call next-positive-hex-int/disp32
4338
4339 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4340
4341
4342 68/push "F - test-next-positive-hex-int-0x-prefix"/imm32
4343 68/push 0x34/imm32
4344 50/push-EAX
4345
4346 e8/call check-ints-equal/disp32
4347
4348 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4349
4350 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4351 5d/pop-to-EBP
4352 c3/return
4353
4354 test-next-positive-hex-int-zero:
4355
4356 55/push-EBP
4357 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4358
4359 b8/copy-to-EAX "0"/imm32
4360 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4361 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4362 05/add-to-EAX 4/imm32
4363
4364 51/push-ECX
4365 50/push-EAX
4366 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4367
4368
4369 51/push-ECX
4370
4371 e8/call next-positive-hex-int/disp32
4372
4373 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4374
4375
4376 68/push "F - test-next-positive-hex-int-zero"/imm32
4377 68/push 0/imm32
4378 50/push-EAX
4379
4380 e8/call check-ints-equal/disp32
4381
4382 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4383
4384 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4385 5d/pop-to-EBP
4386 c3/return
4387
4388 test-next-positive-hex-int-0-prefix:
4389
4390 55/push-EBP
4391 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . .
4392
4393 b8/copy-to-EAX "03)"/imm32
4394 8b/copy 0/mod/indirect 0/rm32/EAX . . . 1/r32/ECX . .
4395 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/EAX 1/index/ECX . 1/r32/ECX 4/disp8 .
4396 05/add-to-EAX 4/imm32
4397
4398 51/push-ECX
4399 50/push-EAX
4400 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . .
4401
4402
4403 51/push-ECX
4404
4405 e8/call next-positive-hex-int/disp32
4406
4407 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32
4408
4409
4410 68/push "F - test-next-positive-hex-int-0-prefix"/imm32
4411 68/push 3/imm32
4412 50/push-EAX
4413
4414 e8/call check-ints-equal/disp32
4415
4416 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32
4417
4418 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . .
4419 5d/pop-to-EBP
4420 c3/return
4421
4422 == data
4423 Registers:
4424
4425 0x40/imm32/write
4426 0/imm32/read
4427 0x40/imm32/length
4428
4429 "eax"/imm32 0/imm32
4430 "ecx"/imm32 1/imm32
4431 "edx"/imm32 2/imm32
4432 "ebx"/imm32 3/imm32
4433 "esp"/imm32 4/imm32
4434 "ebp"/imm32 5/imm32
4435 "esi"/imm32 6/imm32
4436 "edi"/imm32 7/imm32
4437
4438