https://github.com/akkartik/mu/blob/master/apps/sigils.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
39
40
41
42
43
44
45
46
47
48
49 == code
50
51
52
53
54 Entry:
55
56 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
57
58
59
60
61 68/push Heap/imm32
62 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32
63
64 e8/call new-segment/disp32
65
66 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
67
68
69
70 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32
71 7e/jump-if-lesser-or-equal $run-main/disp8
72
73
74
75 68/push "test"/imm32
76 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
77
78 e8/call kernel-string-equal?/disp32
79
80 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
81
82 3d/compare-eax-and 0/imm32
83 74/jump-if-equal $run-main/disp8
84
85 e8/call run-tests/disp32
86
87 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32
88 eb/jump $main:end/disp8
89 $run-main:
90
91
92
93 68/push Stdout/imm32
94 68/push Stdin/imm32
95
96 e8/call convert/disp32
97
98 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
99
100 bb/copy-to-ebx 0/imm32
101 $main:end:
102 b8/copy-to-eax 1/imm32/exit
103 cd/syscall 0x80/imm8
104
105
106
107 convert:
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137 55/push-ebp
138 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
139
140 50/push-eax
141 51/push-ecx
142 52/push-edx
143 53/push-ebx
144
145 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 0x200/imm32
146 68/push 0x200/imm32/length
147 68/push 0/imm32/read
148 68/push 0/imm32/write
149 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
150
151 68/push 0/imm32/end
152 68/push 0/imm32/start
153 89/copy 3/mod/direct 2/rm32/edx . . . 4/r32/esp . .
154 $convert:line-loop:
155
156
157 51/push-ecx
158
159 e8/call clear-stream/disp32
160
161 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
162
163
164 51/push-ecx
165 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
166
167 e8/call read-line-buffered/disp32
168
169 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
170 $convert:check0:
171
172 81 7/subop/compare 0/mod/indirect 1/rm32/ecx . . . . . 0/imm32
173 0f 84/jump-if-equal $convert:break/disp32
174 $convert:word-loop:
175
176
177 52/push-edx
178 51/push-ecx
179
180 e8/call next-word-or-expression/disp32
181
182 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
183 $convert:check1:
184
185
186
187 52/push-edx
188
189 e8/call slice-empty?/disp32
190
191 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
192
193 3d/compare-eax-and 0/imm32
194 0f 85/jump-if-not-equal $convert:next-line/disp32
195 $convert:check-for-comment:
196
197
198 8b/copy 0/mod/indirect 2/rm32/edx . . . 3/r32/ebx . .
199
200 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
201 8a/copy-byte 0/mod/indirect 3/rm32/ebx . . . 0/r32/AL . .
202
203 3d/compare-eax-and 0x23/imm32/hash
204 74/jump-if-equal $convert:word-loop/disp8
205 $convert:check-for-direct-mode:
206
207 3d/compare-eax-and 0x25/imm32/percent
208 75/jump-if-not-equal $convert:check-for-indirect-mode/disp8
209 $convert:direct-mode:
210 +-- 46 lines: #? # dump word-slice -----------------------------------------------------------------------------------------------------------------------
256
257
258 52/push-edx
259 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
260
261 e8/call emit-direct-mode/disp32
262
263 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
264
265 e9/jump $convert:next-word/disp32
266 $convert:check-for-indirect-mode:
267
268 3d/compare-eax-and 0x2a/imm32/asterisk
269 75/jump-if-not-equal $convert:check-for-invalid-addition/disp8
270
271
272
273 52/push-edx
274
275 e8/call disp32-mode?/disp32
276
277 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
278
279 3d/compare-eax-and 0/imm32
280 74/jump-if-equal $convert:indirect-mode/disp8
281 $convert:disp32-mode:
282
283
284 52/push-edx
285 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
286
287 e8/call emit-indirect-disp32/disp32
288
289 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
290
291 e9/jump $convert:next-word/disp32
292 $convert:indirect-mode:
293
294 50/push-eax
295 51/push-ecx
296 52/push-edx
297 53/push-ebx
298
299
300 52/push-edx
301
302 e8/call parse-effective-address/disp32
303
304 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
305
306
307 53/push-ebx
308 52/push-edx
309 51/push-ecx
310 50/push-eax
311 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
312
313 e8/call emit-indirect-mode/disp32
314
315 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
316
317 5b/pop-to-ebx
318 5a/pop-to-edx
319 59/pop-to-ecx
320 58/pop-to-eax
321
322 e9/jump $convert:next-word/disp32
323 $convert:check-for-invalid-addition:
324
325 3d/compare-eax-and 0x2b/imm32/plus
326 74/jump-if-equal $convert:error1/disp8
327 $convert:check-for-invalid-left-shift:
328
329 3d/compare-eax-and 0x3c/imm32/less-than
330 74/jump-if-equal $convert:error1/disp8
331 $convert:regular-word:
332
333
334 52/push-edx
335 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
336
337 e8/call write-slice-buffered/disp32
338
339 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
340
341 $convert:next-word:
342
343
344 68/push " "/imm32
345 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
346
347 e8/call write-buffered/disp32
348
349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
350
351 e9/jump $convert:word-loop/disp32
352 $convert:next-line:
353
354
355 68/push Newline/imm32
356 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
357
358 e8/call write-buffered/disp32
359
360 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
361
362 e9/jump $convert:line-loop/disp32
363 $convert:break:
364
365
366 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
367
368 e8/call flush/disp32
369
370 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
371 $convert:end:
372
373 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x214/imm32
374
375 5b/pop-to-ebx
376 5a/pop-to-edx
377 59/pop-to-ecx
378 58/pop-to-eax
379
380 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
381 5d/pop-to-ebp
382 c3/return
383
384 $convert:error1:
385
386
387
388 68/push "error: '"/imm32
389 68/push Stderr/imm32
390
391 e8/call write-buffered/disp32
392
393 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
394
395
396 50/push-eax
397 68/push Stderr/imm32
398
399 e8/call write-byte-buffered/disp32
400
401 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
402
403
404 68/push "' only permitted within '*(...)' in '"/imm32
405 68/push Stderr/imm32
406
407 e8/call write-buffered/disp32
408
409 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
410
411
412 51/push-ecx
413 68/push Stderr/imm32
414
415 e8/call write-stream-data/disp32
416
417 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
418
419
420 68/push "'"/imm32
421 68/push Stderr/imm32
422
423 e8/call write-buffered/disp32
424
425 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
426
427
428 68/push Stderr/imm32
429
430 e8/call flush/disp32
431
432 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
433
434 bb/copy-to-ebx 1/imm32
435 b8/copy-to-eax 1/imm32/exit
436 cd/syscall 0x80/imm8
437
438
439 test-convert-passes-most-words-through:
440
441 55/push-ebp
442 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
443
444
445
446 68/push _test-input-stream/imm32
447
448 e8/call clear-stream/disp32
449
450 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
451
452
453 b8/copy-to-eax _test-input-buffered-file/imm32
454 05/add-to-eax 4/imm32
455 50/push-eax
456
457 e8/call clear-stream/disp32
458
459 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
460
461
462 68/push _test-output-stream/imm32
463
464 e8/call clear-stream/disp32
465
466 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
467
468
469 b8/copy-to-eax _test-output-buffered-file/imm32
470 05/add-to-eax 4/imm32
471 50/push-eax
472
473 e8/call clear-stream/disp32
474
475 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
476
477
478
479 68/push "== abcd 0x1"/imm32
480 68/push _test-input-stream/imm32
481
482 e8/call write/disp32
483
484 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
485
486
487 68/push _test-output-buffered-file/imm32
488 68/push _test-input-buffered-file/imm32
489
490 e8/call convert/disp32
491
492 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
493
494
495
496 68/push _test-output-buffered-file/imm32
497
498 e8/call flush/disp32
499
500 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
501 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
527
528
529 68/push "F - test-convert-passes-most-words-through"/imm32
530 68/push "== abcd 0x1 \n"/imm32
531 68/push _test-output-stream/imm32
532
533 e8/call check-stream-equal/disp32
534
535 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
536
537 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
538 5d/pop-to-ebp
539 c3/return
540
541 test-convert-direct-mode:
542
543 55/push-ebp
544 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
545
546
547
548 68/push _test-input-stream/imm32
549
550 e8/call clear-stream/disp32
551
552 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
553
554
555 b8/copy-to-eax _test-input-buffered-file/imm32
556 05/add-to-eax 4/imm32
557 50/push-eax
558
559 e8/call clear-stream/disp32
560
561 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
562
563
564 68/push _test-output-stream/imm32
565
566 e8/call clear-stream/disp32
567
568 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
569
570
571 b8/copy-to-eax _test-output-buffered-file/imm32
572 05/add-to-eax 4/imm32
573 50/push-eax
574
575 e8/call clear-stream/disp32
576
577 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
578
579
580
581 68/push "ab %ecx"/imm32
582 68/push _test-input-stream/imm32
583
584 e8/call write/disp32
585
586 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
587
588
589 68/push _test-output-buffered-file/imm32
590 68/push _test-input-buffered-file/imm32
591
592 e8/call convert/disp32
593
594 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
595
596
597
598 68/push _test-output-buffered-file/imm32
599
600 e8/call flush/disp32
601
602 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
603 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
629
630
631 68/push "F - test-convert-direct-mode"/imm32
632 68/push "ab 3/mod/direct 0x00000001/rm32 \n"/imm32
633 68/push _test-output-stream/imm32
634
635 e8/call check-stream-equal/disp32
636
637 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
638
639 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
640 5d/pop-to-ebp
641 c3/return
642
643 test-convert-direct-mode-with-metadata:
644
645 55/push-ebp
646 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
647
648
649
650 68/push _test-input-stream/imm32
651
652 e8/call clear-stream/disp32
653
654 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
655
656
657 b8/copy-to-eax _test-input-buffered-file/imm32
658 05/add-to-eax 4/imm32
659 50/push-eax
660
661 e8/call clear-stream/disp32
662
663 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
664
665
666 68/push _test-output-stream/imm32
667
668 e8/call clear-stream/disp32
669
670 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
671
672
673 b8/copy-to-eax _test-output-buffered-file/imm32
674 05/add-to-eax 4/imm32
675 50/push-eax
676
677 e8/call clear-stream/disp32
678
679 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
680
681
682
683 68/push "ab %ecx/foo"/imm32
684 68/push _test-input-stream/imm32
685
686 e8/call write/disp32
687
688 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
689
690
691 68/push _test-output-buffered-file/imm32
692 68/push _test-input-buffered-file/imm32
693
694 e8/call convert/disp32
695
696 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
697
698
699
700 68/push _test-output-buffered-file/imm32
701
702 e8/call flush/disp32
703
704 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
705
706
707 68/push "F - test-convert-direct-mode-with-metadata"/imm32
708 68/push "ab 3/mod/direct 0x00000001/rm32 \n"/imm32
709 68/push _test-output-stream/imm32
710
711 e8/call check-stream-equal/disp32
712
713 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
714
715 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
716 5d/pop-to-ebp
717 c3/return
718
719 test-convert-register-indirect-mode:
720
721 55/push-ebp
722 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
723
724
725
726 68/push _test-input-stream/imm32
727
728 e8/call clear-stream/disp32
729
730 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
731
732
733 b8/copy-to-eax _test-input-buffered-file/imm32
734 05/add-to-eax 4/imm32
735 50/push-eax
736
737 e8/call clear-stream/disp32
738
739 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
740
741
742 68/push _test-output-stream/imm32
743
744 e8/call clear-stream/disp32
745
746 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
747
748
749 b8/copy-to-eax _test-output-buffered-file/imm32
750 05/add-to-eax 4/imm32
751 50/push-eax
752
753 e8/call clear-stream/disp32
754
755 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
756
757
758
759 68/push "ab *ecx"/imm32
760 68/push _test-input-stream/imm32
761
762 e8/call write/disp32
763
764 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
765
766
767 68/push _test-output-buffered-file/imm32
768 68/push _test-input-buffered-file/imm32
769
770 e8/call convert/disp32
771
772 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
773
774
775
776 68/push _test-output-buffered-file/imm32
777
778 e8/call flush/disp32
779
780 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
781 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
807
808
809 68/push "F - test-convert-register-indirect-mode"/imm32
810 68/push "ab 0/mod/indirect 0x00000001/rm32 \n"/imm32
811 68/push _test-output-stream/imm32
812
813 e8/call check-stream-equal/disp32
814
815 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
816
817 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
818 5d/pop-to-ebp
819 c3/return
820
821 test-convert-register-indirect-mode-with-metadata:
822
823 55/push-ebp
824 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
825
826
827
828 68/push _test-input-stream/imm32
829
830 e8/call clear-stream/disp32
831
832 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
833
834
835 b8/copy-to-eax _test-input-buffered-file/imm32
836 05/add-to-eax 4/imm32
837 50/push-eax
838
839 e8/call clear-stream/disp32
840
841 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
842
843
844 68/push _test-output-stream/imm32
845
846 e8/call clear-stream/disp32
847
848 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
849
850
851 b8/copy-to-eax _test-output-buffered-file/imm32
852 05/add-to-eax 4/imm32
853 50/push-eax
854
855 e8/call clear-stream/disp32
856
857 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
858
859
860
861 68/push "ab *ecx/foo"/imm32
862 68/push _test-input-stream/imm32
863
864 e8/call write/disp32
865
866 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
867
868
869 68/push _test-output-buffered-file/imm32
870 68/push _test-input-buffered-file/imm32
871
872 e8/call convert/disp32
873
874 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
875
876
877
878 68/push _test-output-buffered-file/imm32
879
880 e8/call flush/disp32
881
882 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
883
884
885 68/push "F - test-convert-register-indirect-mode-with-metadata"/imm32
886 68/push "ab 0/mod/indirect 0x00000001/rm32 \n"/imm32
887 68/push _test-output-stream/imm32
888
889 e8/call check-stream-equal/disp32
890
891 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
892
893 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
894 5d/pop-to-ebp
895 c3/return
896
897 test-convert-register-indirect-mode-without-displacement:
898
899 55/push-ebp
900 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
901
902
903
904 68/push _test-input-stream/imm32
905
906 e8/call clear-stream/disp32
907
908 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
909
910
911 b8/copy-to-eax _test-input-buffered-file/imm32
912 05/add-to-eax 4/imm32
913 50/push-eax
914
915 e8/call clear-stream/disp32
916
917 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
918
919
920 68/push _test-output-stream/imm32
921
922 e8/call clear-stream/disp32
923
924 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
925
926
927 b8/copy-to-eax _test-output-buffered-file/imm32
928 05/add-to-eax 4/imm32
929 50/push-eax
930
931 e8/call clear-stream/disp32
932
933 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
934
935
936
937 68/push "ab *(ecx)"/imm32
938 68/push _test-input-stream/imm32
939
940 e8/call write/disp32
941
942 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
943
944
945 68/push _test-output-buffered-file/imm32
946 68/push _test-input-buffered-file/imm32
947
948 e8/call convert/disp32
949
950 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
951
952
953
954 68/push _test-output-buffered-file/imm32
955
956 e8/call flush/disp32
957
958 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
959 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
985
986
987 68/push "F - test-convert-register-indirect-mode-without-displacement"/imm32
988 68/push "ab 0/mod/indirect 0x00000001/rm32 \n"/imm32
989 68/push _test-output-stream/imm32
990
991 e8/call check-stream-equal/disp32
992
993 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
994
995 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
996 5d/pop-to-ebp
997 c3/return
998
999 test-convert-register-indirect-mode-with-displacement:
1000
1001 55/push-ebp
1002 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1003
1004
1005
1006 68/push _test-input-stream/imm32
1007
1008 e8/call clear-stream/disp32
1009
1010 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1011
1012
1013 b8/copy-to-eax _test-input-buffered-file/imm32
1014 05/add-to-eax 4/imm32
1015 50/push-eax
1016
1017 e8/call clear-stream/disp32
1018
1019 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1020
1021
1022 68/push _test-output-stream/imm32
1023
1024 e8/call clear-stream/disp32
1025
1026 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1027
1028
1029 b8/copy-to-eax _test-output-buffered-file/imm32
1030 05/add-to-eax 4/imm32
1031 50/push-eax
1032
1033 e8/call clear-stream/disp32
1034
1035 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1036
1037
1038
1039 68/push "ab *(ecx+4)"/imm32
1040 68/push _test-input-stream/imm32
1041
1042 e8/call write/disp32
1043
1044 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1045
1046
1047 68/push _test-output-buffered-file/imm32
1048 68/push _test-input-buffered-file/imm32
1049
1050 e8/call convert/disp32
1051
1052 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1053
1054
1055
1056 68/push _test-output-buffered-file/imm32
1057
1058 e8/call flush/disp32
1059
1060 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1061 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
1087
1088
1089 68/push "F - test-convert-register-indirect-mode-with-displacement"/imm32
1090 68/push "ab 2/mod/*+disp32 0x00000001/rm32 0x00000004/disp32 \n"/imm32
1091 68/push _test-output-stream/imm32
1092
1093 e8/call check-stream-equal/disp32
1094
1095 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1096
1097 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1098 5d/pop-to-ebp
1099 c3/return
1100
1101
1102 test-convert-register-indirect-mode-with-sib-byte:
1103
1104 55/push-ebp
1105 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1106
1107
1108
1109 68/push _test-input-stream/imm32
1110
1111 e8/call clear-stream/disp32
1112
1113 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1114
1115
1116 b8/copy-to-eax _test-input-buffered-file/imm32
1117 05/add-to-eax 4/imm32
1118 50/push-eax
1119
1120 e8/call clear-stream/disp32
1121
1122 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1123
1124
1125 68/push _test-output-stream/imm32
1126
1127 e8/call clear-stream/disp32
1128
1129 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1130
1131
1132 b8/copy-to-eax _test-output-buffered-file/imm32
1133 05/add-to-eax 4/imm32
1134 50/push-eax
1135
1136 e8/call clear-stream/disp32
1137
1138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1139
1140
1141
1142 68/push "ab *(ecx + edx<<3 + 4)"/imm32
1143 68/push _test-input-stream/imm32
1144
1145 e8/call write/disp32
1146
1147 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1148
1149
1150 68/push _test-output-buffered-file/imm32
1151 68/push _test-input-buffered-file/imm32
1152
1153 e8/call convert/disp32
1154
1155 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1156
1157
1158
1159 68/push _test-output-buffered-file/imm32
1160
1161 e8/call flush/disp32
1162
1163 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1164 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
1190
1191
1192 68/push "F - test-convert-register-indirect-mode-with-sib-byte"/imm32
1193 68/push "ab 2/mod/*+disp32 4/rm32/sib 0x00000001/base 0x00000002/index 0x00000003/scale 0x00000004/disp32 \n"/imm32
1194 68/push _test-output-stream/imm32
1195
1196 e8/call check-stream-equal/disp32
1197
1198 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1199
1200 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1201 5d/pop-to-ebp
1202 c3/return
1203
1204 test-convert-register-indirect-mode-with-sib-byte-negative-displacement:
1205
1206 55/push-ebp
1207 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1208
1209
1210
1211 68/push _test-input-stream/imm32
1212
1213 e8/call clear-stream/disp32
1214
1215 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1216
1217
1218 b8/copy-to-eax _test-input-buffered-file/imm32
1219 05/add-to-eax 4/imm32
1220 50/push-eax
1221
1222 e8/call clear-stream/disp32
1223
1224 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1225
1226
1227 68/push _test-output-stream/imm32
1228
1229 e8/call clear-stream/disp32
1230
1231 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1232
1233
1234 b8/copy-to-eax _test-output-buffered-file/imm32
1235 05/add-to-eax 4/imm32
1236 50/push-eax
1237
1238 e8/call clear-stream/disp32
1239
1240 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1241
1242
1243
1244 68/push "ab *(ecx + edx<<3 - 4)"/imm32
1245 68/push _test-input-stream/imm32
1246
1247 e8/call write/disp32
1248
1249 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1250
1251
1252 68/push _test-output-buffered-file/imm32
1253 68/push _test-input-buffered-file/imm32
1254
1255 e8/call convert/disp32
1256
1257 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1258
1259
1260
1261 68/push _test-output-buffered-file/imm32
1262
1263 e8/call flush/disp32
1264
1265 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1266 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
1292
1293
1294 68/push "F - test-convert-register-indirect-mode-with-sib-byte-negative-displacement"/imm32
1295 68/push "ab 2/mod/*+disp32 4/rm32/sib 0x00000001/base 0x00000002/index 0x00000003/scale 0xfffffffc/disp32 \n"/imm32
1296 68/push _test-output-stream/imm32
1297
1298 e8/call check-stream-equal/disp32
1299
1300 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1301
1302 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1303 5d/pop-to-ebp
1304 c3/return
1305
1306 test-convert-indirect-mode-without-register:
1307
1308 55/push-ebp
1309 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1310
1311
1312
1313 68/push _test-input-stream/imm32
1314
1315 e8/call clear-stream/disp32
1316
1317 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1318
1319
1320 b8/copy-to-eax _test-input-buffered-file/imm32
1321 05/add-to-eax 4/imm32
1322 50/push-eax
1323
1324 e8/call clear-stream/disp32
1325
1326 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1327
1328
1329 68/push _test-output-stream/imm32
1330
1331 e8/call clear-stream/disp32
1332
1333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1334
1335
1336 b8/copy-to-eax _test-output-buffered-file/imm32
1337 05/add-to-eax 4/imm32
1338 50/push-eax
1339
1340 e8/call clear-stream/disp32
1341
1342 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1343
1344
1345
1346 68/push "ab *Foo"/imm32
1347 68/push _test-input-stream/imm32
1348
1349 e8/call write/disp32
1350
1351 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1352
1353
1354 68/push _test-output-buffered-file/imm32
1355 68/push _test-input-buffered-file/imm32
1356
1357 e8/call convert/disp32
1358
1359 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1360
1361
1362
1363 68/push _test-output-buffered-file/imm32
1364
1365 e8/call flush/disp32
1366
1367 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1368 +-- 26 lines: #? # dump _test-output-stream --------------------------------------------------------------------------------------------------------------
1394
1395
1396 68/push "F - test-convert-indirect-mode-without-register"/imm32
1397 68/push "ab 0/mod/indirect 5/rm32/.disp32 Foo/disp32 \n"/imm32
1398 68/push _test-output-stream/imm32
1399
1400 e8/call check-stream-equal/disp32
1401
1402 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1403
1404 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1405 5d/pop-to-ebp
1406 c3/return
1407
1408 emit-direct-mode:
1409
1410 55/push-ebp
1411 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1412
1413 50/push-eax
1414
1415 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 0xc/disp8 .
1416 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
1417 ff 6/subop/push 0/mod/indirect 0/rm32/eax . . . . . .
1418 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . .
1419
1420
1421 ff 0/subop/increment 0/mod/indirect 0/rm32/eax . . . . . .
1422
1423
1424 50/push-eax
1425 68/push 0x2f/imm32/slash
1426 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
1427 ff 6/subop/push 0/mod/indirect 0/rm32/eax . . . . . .
1428
1429 e8/call next-token-from-slice/disp32
1430
1431 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
1432
1433
1434 68/push "Registers"/imm32
1435 68/push 8/imm32/row-size
1436 50/push-eax
1437 68/push Registers/imm32
1438
1439 e8/call get-slice/disp32
1440
1441 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
1442
1443
1444 68/push "3/mod/direct "/imm32
1445 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1446
1447 e8/call write-buffered/disp32
1448
1449 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1450
1451
1452 ff 6/subop/push 0/mod/indirect 0/rm32/eax . . . . . .
1453 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1454
1455 e8/call print-int32-buffered/disp32
1456
1457 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1458
1459
1460 68/push "/rm32"/imm32
1461 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1462
1463 e8/call write-buffered/disp32
1464
1465 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1466 $emit-direct-mode:end:
1467
1468 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1469
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 test-emit-direct-mode:
1477
1478 55/push-ebp
1479 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1480
1481
1482
1483 68/push _test-output-stream/imm32
1484
1485 e8/call clear-stream/disp32
1486
1487 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1488
1489
1490 b8/copy-to-eax _test-output-buffered-file/imm32
1491 05/add-to-eax 4/imm32
1492 50/push-eax
1493
1494 e8/call clear-stream/disp32
1495
1496 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1497
1498 b8/copy-to-eax "%eax"/imm32
1499 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1500 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1501 05/add-to-eax 4/imm32
1502
1503 51/push-ecx
1504 50/push-eax
1505 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1506
1507
1508 51/push-ecx
1509 68/push _test-output-buffered-file/imm32
1510
1511 e8/call emit-direct-mode/disp32
1512
1513 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1514
1515
1516 68/push _test-output-buffered-file/imm32
1517
1518 e8/call flush/disp32
1519
1520 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1521 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1547
1548
1549 68/push "F - test-emit-direct-mode/0"/imm32
1550 68/push "3/mod/direct 0x00000000/rm32"/imm32
1551 68/push _test-output-stream/imm32
1552
1553 e8/call check-stream-equal/disp32
1554
1555 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1556
1557 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1558 5d/pop-to-ebp
1559 c3/return
1560
1561 test-emit-direct-mode-2:
1562
1563 55/push-ebp
1564 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1565
1566
1567
1568 68/push _test-output-stream/imm32
1569
1570 e8/call clear-stream/disp32
1571
1572 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1573
1574
1575 b8/copy-to-eax _test-output-buffered-file/imm32
1576 05/add-to-eax 4/imm32
1577 50/push-eax
1578
1579 e8/call clear-stream/disp32
1580
1581 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1582
1583 b8/copy-to-eax "%edi"/imm32
1584 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
1585 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
1586 05/add-to-eax 4/imm32
1587
1588 51/push-ecx
1589 50/push-eax
1590 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1591
1592
1593 51/push-ecx
1594 68/push _test-output-buffered-file/imm32
1595
1596 e8/call emit-direct-mode/disp32
1597
1598 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1599
1600
1601 68/push _test-output-buffered-file/imm32
1602
1603 e8/call flush/disp32
1604
1605 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1606 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
1632
1633
1634 68/push "F - test-emit-direct-mode/1"/imm32
1635 68/push "3/mod/direct 0x00000007/rm32"/imm32
1636 68/push _test-output-stream/imm32
1637
1638 e8/call check-stream-equal/disp32
1639
1640 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1641
1642 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1643 5d/pop-to-ebp
1644 c3/return
1645
1646
1647
1648
1649
1650
1651
1652 next-word-or-expression:
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680 55/push-ebp
1681 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1682
1683 50/push-eax
1684 51/push-ecx
1685 56/push-esi
1686 57/push-edi
1687
1688 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
1689
1690 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 7/r32/edi 0xc/disp8 .
1691
1692
1693 68/push 0x20/imm32/space
1694 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1695
1696 e8/call skip-chars-matching/disp32
1697
1698 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1699 $next-word-or-expression:check0:
1700
1701
1702 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 .
1703
1704 3b/compare 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
1705 7c/jump-if-lesser $next-word-or-expression:check-for-comment/disp8
1706
1707 c7 0/subop/copy 0/mod/direct 7/rm32/edi . . . . . 0/imm32
1708 c7 0/subop/copy 1/mod/*+disp8 7/rm32/edi . . . . 4/disp8 0/imm32
1709 e9/jump $next-word-or-expression:end/disp32
1710 $next-word-or-expression:check-for-comment:
1711
1712 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/eax 0xc/disp8 .
1713 89/copy 0/mod/indirect 7/rm32/edi . . . 0/r32/eax . .
1714
1715
1716 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1717 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xc/disp8 .
1718
1719 3d/compare-eax-and 0x23/imm32/pound
1720 75/jump-if-not-equal $next-word-or-expression:check-for-string-literal/disp8
1721 $next-word-or-expression:comment:
1722
1723 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
1724 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax . 0/r32/eax 0xc/disp8 .
1725 89/copy 1/mod/*+disp8 7/rm32/edi . . . 0/r32/eax 4/disp8 .
1726
1727 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
1728 89/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 4/disp8 .
1729
1730 eb/jump $next-word-or-expression:end/disp8
1731 $next-word-or-expression:check-for-string-literal:
1732
1733 3d/compare-eax-and 0x22/imm32/dquote
1734 75/jump-if-not-equal $next-word-or-expression:check-for-expression/disp8
1735 $next-word-or-expression:string-literal:
1736
1737
1738 56/push-esi
1739
1740 e8/call skip-string/disp32
1741
1742 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1743
1744 eb/jump $next-word-or-expression:regular-word/disp8
1745 $next-word-or-expression:check-for-expression:
1746
1747 3d/compare-eax-and 0x2a/imm32/asterisk
1748 75/jump-if-not-equal $next-word-or-expression:regular-word/disp8
1749
1750 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xd/disp8 .
1751 3d/compare-eax-and 0x20/imm32/space
1752 74/jump-if-equal $next-word-or-expression:error1/disp8
1753
1754 3d/compare-eax-and 0x28/imm32/open-paren
1755 75/jump-if-not-equal $next-word-or-expression:regular-word/disp8
1756 $next-word-or-expression:paren:
1757
1758
1759 56/push-esi
1760
1761 e8/call skip-until-close-paren/disp32
1762
1763 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1764
1765
1766 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 .
1767 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xc/disp8 .
1768
1769 3d/compare-eax-and 0x29/imm32/close-paren
1770 75/jump-if-not-equal $next-word-or-expression:error2/disp8
1771
1772 ff 0/subop/increment 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
1773
1774 $next-word-or-expression:regular-word:
1775
1776
1777 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1778
1779 e8/call skip-chars-not-matching-whitespace/disp32
1780
1781 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1782
1783 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 .
1784 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/eax 0xc/disp8 .
1785 89/copy 1/mod/*+disp8 7/rm32/edi . . . 0/r32/eax 4/disp8 .
1786 $next-word-or-expression:end:
1787
1788 5f/pop-to-edi
1789 5e/pop-to-esi
1790 59/pop-to-ecx
1791 58/pop-to-eax
1792
1793 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1794 5d/pop-to-ebp
1795 c3/return
1796
1797 $next-word-or-expression:error1:
1798
1799
1800
1801 68/push "error: no space allowed after '*' in '"/imm32
1802 68/push Stderr/imm32
1803
1804 e8/call write-buffered/disp32
1805
1806 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1807
1808
1809 56/push-esi
1810 68/push Stderr/imm32
1811
1812 e8/call write-stream-data/disp32
1813
1814 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1815
1816
1817 68/push "'"/imm32
1818 68/push Stderr/imm32
1819
1820 e8/call write-buffered/disp32
1821
1822 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1823
1824
1825 68/push Stderr/imm32
1826
1827 e8/call flush/disp32
1828
1829 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1830
1831 bb/copy-to-ebx 1/imm32
1832 b8/copy-to-eax 1/imm32/exit
1833 cd/syscall 0x80/imm8
1834
1835
1836 $next-word-or-expression:error2:
1837
1838
1839
1840 68/push "error: *(...) expression must be all on a single line in '"/imm32
1841 68/push Stderr/imm32
1842
1843 e8/call write-buffered/disp32
1844
1845 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1846
1847
1848 56/push-esi
1849 68/push Stderr/imm32
1850
1851 e8/call write-stream-data/disp32
1852
1853 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1854
1855
1856 68/push "'"/imm32
1857 68/push Stderr/imm32
1858
1859 e8/call write-buffered/disp32
1860
1861 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1862
1863
1864 68/push Stderr/imm32
1865
1866 e8/call flush/disp32
1867
1868 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1869
1870 bb/copy-to-ebx 1/imm32
1871 b8/copy-to-eax 1/imm32/exit
1872 cd/syscall 0x80/imm8
1873
1874
1875 test-next-word-or-expression:
1876
1877 55/push-ebp
1878 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1879
1880
1881
1882 68/push _test-input-stream/imm32
1883
1884 e8/call clear-stream/disp32
1885
1886 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1887
1888 68/push 0/imm32/end
1889 68/push 0/imm32/start
1890 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1891
1892
1893 68/push " ab"/imm32
1894 68/push _test-input-stream/imm32
1895
1896 e8/call write/disp32
1897
1898 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1899
1900
1901 51/push-ecx
1902 68/push _test-input-stream/imm32
1903
1904 e8/call next-word-or-expression/disp32
1905
1906 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1907
1908
1909 68/push "F - test-next-word-or-expression/updates-stream-read-correctly"/imm32
1910 68/push 4/imm32
1911 b8/copy-to-eax _test-input-stream/imm32
1912 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
1913
1914 e8/call check-ints-equal/disp32
1915
1916 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1917
1918
1919
1920 68/push "F - test-next-word-or-expression: start"/imm32
1921 68/push 0xe/imm32
1922
1923 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
1924 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
1925 50/push-eax
1926
1927 e8/call check-ints-equal/disp32
1928
1929 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1930
1931
1932
1933 68/push "F - test-next-word-or-expression: end"/imm32
1934 68/push 0x10/imm32
1935
1936 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
1937 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
1938 50/push-eax
1939
1940 e8/call check-ints-equal/disp32
1941
1942 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1943
1944 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1945 5d/pop-to-ebp
1946 c3/return
1947
1948 test-next-word-or-expression-returns-whole-comment:
1949
1950 55/push-ebp
1951 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1952
1953
1954
1955 68/push _test-input-stream/imm32
1956
1957 e8/call clear-stream/disp32
1958
1959 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1960
1961 68/push 0/imm32/end
1962 68/push 0/imm32/start
1963 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1964
1965
1966 68/push " # a"/imm32
1967 68/push _test-input-stream/imm32
1968
1969 e8/call write/disp32
1970
1971 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1972
1973
1974 51/push-ecx
1975 68/push _test-input-stream/imm32
1976
1977 e8/call next-word-or-expression/disp32
1978
1979 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1980
1981
1982 68/push "F - test-next-word-or-expression-returns-whole-comment/updates-stream-read-correctly"/imm32
1983 68/push 5/imm32
1984 b8/copy-to-eax _test-input-stream/imm32
1985 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
1986
1987 e8/call check-ints-equal/disp32
1988
1989 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1990
1991
1992
1993 68/push "F - test-next-word-or-expression-returns-whole-comment: start"/imm32
1994 68/push 0xe/imm32
1995
1996 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
1997 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
1998 50/push-eax
1999
2000 e8/call check-ints-equal/disp32
2001
2002 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2003
2004
2005
2006 68/push "F - test-next-word-or-expression-returns-whole-comment: end"/imm32
2007 68/push 0x11/imm32
2008
2009 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2010 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2011 50/push-eax
2012
2013 e8/call check-ints-equal/disp32
2014
2015 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2016
2017 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2018 5d/pop-to-ebp
2019 c3/return
2020
2021 test-next-word-or-expression-returns-empty-slice-on-eof:
2022
2023 55/push-ebp
2024 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2025
2026
2027
2028 68/push _test-input-stream/imm32
2029
2030 e8/call clear-stream/disp32
2031
2032 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2033
2034 68/push 0/imm32/end
2035 68/push 0/imm32/start
2036 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2037
2038
2039
2040 51/push-ecx
2041 68/push _test-input-stream/imm32
2042
2043 e8/call next-word-or-expression/disp32
2044
2045 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2046
2047
2048 68/push "F - test-next-word-or-expression-returns-empty-expression-on-eof"/imm32
2049 68/push 0/imm32
2050
2051 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2052 2b/subtract 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
2053 50/push-eax
2054
2055 e8/call check-ints-equal/disp32
2056
2057 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2058
2059 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2060 5d/pop-to-ebp
2061 c3/return
2062
2063 test-next-word-or-expression-returns-string-literal:
2064
2065 55/push-ebp
2066 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2067
2068
2069
2070 68/push _test-input-stream/imm32
2071
2072 e8/call clear-stream/disp32
2073
2074 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2075
2076 68/push 0/imm32/end
2077 68/push 0/imm32/start
2078 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2079
2080
2081 68/push " \"a b\"/imm32 "/imm32
2082 68/push _test-input-stream/imm32
2083
2084 e8/call write/disp32
2085
2086 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2087
2088
2089 51/push-ecx
2090 68/push _test-input-stream/imm32
2091
2092 e8/call next-word-or-expression/disp32
2093
2094 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2095
2096
2097
2098 68/push "F - test-next-word-or-expression-returns-string-literal: start"/imm32
2099 68/push 0xd/imm32
2100
2101 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
2102 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2103 50/push-eax
2104
2105 e8/call check-ints-equal/disp32
2106
2107 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2108
2109
2110
2111 68/push "F - test-next-word-or-expression-returns-string-literal: end"/imm32
2112 68/push 0x18/imm32
2113
2114 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2115 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2116 50/push-eax
2117
2118 e8/call check-ints-equal/disp32
2119
2120 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2121
2122 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2123 5d/pop-to-ebp
2124 c3/return
2125
2126 test-next-word-or-expression-returns-string-with-escapes:
2127
2128 55/push-ebp
2129 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2130
2131
2132
2133 68/push _test-input-stream/imm32
2134
2135 e8/call clear-stream/disp32
2136
2137 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2138
2139 68/push 0/imm32/end
2140 68/push 0/imm32/start
2141 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2142
2143
2144 68/push " \"a\\\"b\"/x"/imm32
2145 68/push _test-input-stream/imm32
2146
2147 e8/call write/disp32
2148
2149 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2150
2151
2152 51/push-ecx
2153 68/push _test-input-stream/imm32
2154
2155 e8/call next-word-or-expression/disp32
2156
2157 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2158
2159
2160
2161 68/push "F - test-next-word-or-expression-returns-string-with-escapes: start"/imm32
2162 68/push 0xd/imm32
2163
2164 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
2165 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2166 50/push-eax
2167
2168 e8/call check-ints-equal/disp32
2169
2170 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2171
2172
2173
2174 68/push "F - test-next-word-or-expression-returns-string-with-escapes: end"/imm32
2175 68/push 0x15/imm32
2176
2177 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2178 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2179 50/push-eax
2180
2181 e8/call check-ints-equal/disp32
2182
2183 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2184
2185 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2186 5d/pop-to-ebp
2187 c3/return
2188
2189 test-next-word-or-expression-returns-whole-expression:
2190
2191 55/push-ebp
2192 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2193
2194
2195
2196 68/push _test-input-stream/imm32
2197
2198 e8/call clear-stream/disp32
2199
2200 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2201
2202 68/push 0/imm32/end
2203 68/push 0/imm32/start
2204 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2205
2206
2207 68/push " *(a b)/imm32 "/imm32
2208 68/push _test-input-stream/imm32
2209
2210 e8/call write/disp32
2211
2212 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2213
2214
2215 51/push-ecx
2216 68/push _test-input-stream/imm32
2217
2218 e8/call next-word-or-expression/disp32
2219
2220 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2221
2222
2223
2224 68/push "F - test-next-word-or-expression-returns-whole-expression: start"/imm32
2225 68/push 0xd/imm32
2226
2227 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
2228 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2229 50/push-eax
2230
2231 e8/call check-ints-equal/disp32
2232
2233 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2234
2235
2236
2237 68/push "F - test-next-word-or-expression-returns-whole-expression: end"/imm32
2238 68/push 0x19/imm32
2239
2240 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2241 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2242 50/push-eax
2243
2244 e8/call check-ints-equal/disp32
2245
2246 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2247
2248 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2249 5d/pop-to-ebp
2250 c3/return
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260 parse-effective-address:
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298 55/push-ebp
2299 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2300
2301 56/push-esi
2302 57/push-edi
2303
2304 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
2305 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2306 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2307 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
2308
2309 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2310
2311
2312 bf/copy-to-edi 0/imm32
2313 b9/copy-to-ecx 4/imm32/no-index
2314 ba/copy-to-edx 0/imm32/.scale
2315 bb/copy-to-ebx 0/imm32/disp
2316 $parse-effective-address:check-for-simple-register:
2317
2318 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2319 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2320 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2321 3d/compare-eax-and 0x28/imm32/open-paren
2322 74/jump-if-equal $parse-effective-address:compound-expression/disp8
2323 $parse-effective-address:simple-register:
2324
2325
2326 56/push-esi
2327 68/push 0x2f/imm32/slash
2328 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2329 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2330
2331 e8/call next-token-from-slice/disp32
2332
2333 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2334
2335
2336
2337 68/push "Registers"/imm32
2338 68/push 8/imm32/row-size
2339 56/push-esi
2340 68/push Registers/imm32
2341
2342 e8/call get-slice/disp32
2343
2344 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2345
2346 8b/copy 0/mod/indirect 0/rm32/eax . . . 7/r32/edi . .
2347
2348 e9/jump $parse-effective-address:end/disp32
2349 $parse-effective-address:compound-expression:
2350
2351 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2352
2353
2354
2355 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2356 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2357
2358 e8/call skip-chars-matching-whitespace-in-slice/disp32
2359
2360 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2361
2362 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2363
2364
2365
2366 56/push-esi
2367
2368 e8/call next-register/disp32
2369
2370 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2371
2372 8b/copy 0/mod/indirect 0/rm32/eax . . . 7/r32/edi . .
2373
2374
2375
2376 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2377 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2378
2379 e8/call skip-chars-matching-whitespace-in-slice/disp32
2380
2381 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2382
2383 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2384
2385 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2386 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2387 3d/compare-eax-and 0x29/imm32/close-paren
2388 0f 84/jump-if-equal $parse-effective-address:end/disp32
2389
2390 3d/compare-eax-and 0x2d/imm32/minus
2391 0f 84/jump-if-equal $parse-effective-address:displacement/disp32
2392
2393 3d/compare-eax-and 0x2b/imm32/plus
2394 0f 85/jump-if-not-equal $parse-effective-address:error1/disp32
2395 $parse-effective-address:check-for-index:
2396
2397 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2398
2399
2400
2401 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2402 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2403
2404 e8/call skip-chars-matching-whitespace-in-slice/disp32
2405
2406 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2407
2408 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2409 $parse-effective-address:resolve-ambiguity:
2410
2411
2412 51/push-ecx
2413
2414
2415 89/copy 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . .
2416
2417 05/add-to-eax 3/imm32
2418
2419 50/push-eax
2420 51/push-ecx
2421
2422 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2423
2424
2425 68/push 8/imm32/row-size
2426 51/push-ecx
2427 68/push Registers/imm32
2428
2429 e8/call maybe-get-slice/disp32
2430
2431 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2432
2433 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2434
2435 59/pop-to-ecx
2436
2437 3d/compare-eax-and 0/imm32
2438 0f 84/jump-if-equal $parse-effective-address:displacement/disp32
2439 $parse-effective-address:index:
2440
2441
2442
2443 56/push-esi
2444
2445 e8/call next-register/disp32
2446
2447 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2448
2449 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2450
2451
2452
2453 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2454 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2455
2456 e8/call skip-chars-matching-whitespace-in-slice/disp32
2457
2458 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2459
2460 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2461
2462 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2463 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2464 3d/compare-eax-and 0x29/imm32/close-paren
2465 0f 84/jump-if-equal $parse-effective-address:end/disp32
2466 $parse-effective-address:check-for-scale:
2467
2468 3d/compare-eax-and 0x3c/imm32/less-than
2469 75/jump-if-not-equal $parse-effective-address:check-for-displacement/disp8
2470
2471 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2472
2473 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2474 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2475 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2476 3d/compare-eax-and 0x3c/imm32/less-than
2477 0f 85/jump-if-not-equal $parse-effective-address:error2/disp32
2478
2479 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2480
2481
2482
2483 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2484 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2485
2486 e8/call skip-chars-matching-whitespace-in-slice/disp32
2487
2488 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2489
2490 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2491 $parse-effective-address:scale:
2492
2493
2494
2495 56/push-esi
2496
2497 e8/call next-positive-hex-int/disp32
2498
2499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2500
2501 89/copy 3/mod/direct 2/rm32/edx . . . 0/r32/eax . .
2502
2503
2504
2505 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2506 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2507
2508 e8/call skip-chars-matching-whitespace-in-slice/disp32
2509
2510 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2511
2512 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2513
2514 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2515 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2516 3d/compare-eax-and 0x29/imm32/close-paren
2517 74/jump-if-equal $parse-effective-address:end/disp8
2518 $parse-effective-address:check-for-displacement:
2519
2520 3d/compare-eax-and 0x2b/imm32/plus
2521 74/jump-if-equal $parse-effective-address:displacement/disp8
2522 3d/compare-eax-and 0x2d/imm32/minus
2523 74/jump-if-equal $parse-effective-address:displacement/disp8
2524 e9/jump $parse-effective-address:error3/disp32
2525 $parse-effective-address:displacement:
2526
2527
2528
2529 56/push-esi
2530
2531 e8/call next-hex-int/disp32
2532
2533 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2534
2535 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2536
2537
2538
2539 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2540 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2541
2542 e8/call skip-chars-matching-whitespace-in-slice/disp32
2543
2544 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2545
2546 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2547
2548 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2549 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2550 3d/compare-eax-and 0x29/imm32/close-paren
2551 0f 85/jump-if-not-equal $parse-effective-address:error4/disp32
2552 $parse-effective-address:end:
2553
2554 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . .
2555
2556 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2557
2558 5f/pop-to-edi
2559 5e/pop-to-esi
2560
2561 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2562 5d/pop-to-ebp
2563 c3/return
2564
2565 $parse-effective-address:error1:
2566
2567
2568
2569 68/push "error: unexpected character: "/imm32
2570 68/push Stderr/imm32
2571
2572 e8/call write-buffered/disp32
2573
2574 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2575
2576
2577 50/push-eax
2578 68/push Stderr/imm32
2579
2580 e8/call print-int32-buffered/disp32
2581
2582 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2583
2584
2585 68/push "\n"/imm32
2586 68/push Stderr/imm32
2587
2588 e8/call write-buffered/disp32
2589
2590 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2591
2592
2593 68/push Stderr/imm32
2594
2595 e8/call flush/disp32
2596
2597 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2598
2599 bb/copy-to-ebx 1/imm32
2600 b8/copy-to-eax 1/imm32/exit
2601 cd/syscall 0x80/imm8
2602
2603
2604 $parse-effective-address:error2:
2605
2606
2607
2608 68/push "error: '<' can only be followed by '<' but got: "/imm32
2609 68/push Stderr/imm32
2610
2611 e8/call write-buffered/disp32
2612
2613 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2614
2615
2616 50/push-eax
2617 68/push Stderr/imm32
2618
2619 e8/call print-int32-buffered/disp32
2620
2621 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2622
2623
2624 68/push "\n"/imm32
2625 68/push Stderr/imm32
2626
2627 e8/call write-buffered/disp32
2628
2629 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2630
2631
2632 68/push Stderr/imm32
2633
2634 e8/call flush/disp32
2635
2636 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2637
2638 bb/copy-to-ebx 1/imm32
2639 b8/copy-to-eax 1/imm32/exit
2640 cd/syscall 0x80/imm8
2641
2642
2643 $parse-effective-address:error3:
2644
2645
2646
2647 68/push "error: unexpected character before displacement: "/imm32
2648 68/push Stderr/imm32
2649
2650 e8/call write-buffered/disp32
2651
2652 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2653
2654
2655 50/push-eax
2656 68/push Stderr/imm32
2657
2658 e8/call print-int32-buffered/disp32
2659
2660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2661
2662
2663 68/push "\n"/imm32
2664 68/push Stderr/imm32
2665
2666 e8/call write-buffered/disp32
2667
2668 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2669
2670
2671 68/push Stderr/imm32
2672
2673 e8/call flush/disp32
2674
2675 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2676
2677 bb/copy-to-ebx 1/imm32
2678 b8/copy-to-eax 1/imm32/exit
2679 cd/syscall 0x80/imm8
2680
2681
2682 $parse-effective-address:error4:
2683
2684
2685
2686 68/push "error: unexpected character after displacement: "/imm32
2687 68/push Stderr/imm32
2688
2689 e8/call write-buffered/disp32
2690
2691 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2692
2693
2694 50/push-eax
2695 68/push Stderr/imm32
2696
2697 e8/call print-int32-buffered/disp32
2698
2699 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2700
2701
2702 68/push "; expected ')' to wrap up\n"/imm32
2703 68/push Stderr/imm32
2704
2705 e8/call write-buffered/disp32
2706
2707 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2708
2709
2710 68/push Stderr/imm32
2711
2712 e8/call flush/disp32
2713
2714 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2715
2716 bb/copy-to-ebx 1/imm32
2717 b8/copy-to-eax 1/imm32/exit
2718 cd/syscall 0x80/imm8
2719
2720
2721
2722
2723 next-register:
2724
2725 55/push-ebp
2726 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2727
2728 51/push-ecx
2729 56/push-esi
2730
2731 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
2732
2733 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2734 05/add-to-eax 3/imm32
2735 50/push-eax
2736 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2737 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2738
2739 81 0/subop/add 0/mod/indirect 6/rm32/esi . . . . . 3/imm32
2740
2741
2742 68/push "next-register"/imm32
2743 68/push 8/imm32/row-size
2744 51/push-ecx
2745 68/push Registers/imm32
2746
2747 e8/call get-slice/disp32
2748
2749 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2750 $next-register:end:
2751
2752 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2753
2754 5e/pop-to-esi
2755 59/pop-to-ecx
2756
2757 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2758 5d/pop-to-ebp
2759 c3/return
2760
2761 test-parse-effective-address-simple:
2762
2763 55/push-ebp
2764 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2765
2766 b8/copy-to-eax "*esi"/imm32
2767 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2768 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2769 05/add-to-eax 4/imm32
2770
2771 51/push-ecx
2772 50/push-eax
2773 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2774
2775
2776 51/push-ecx
2777
2778 e8/call parse-effective-address/disp32
2779
2780 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2781
2782
2783
2784 68/push "F - test-parse-effective-address-simple/base"/imm32
2785 68/push 6/imm32/esi
2786 50/push-eax
2787
2788 e8/call check-ints-equal/disp32
2789
2790 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2791
2792
2793 68/push "F - test-parse-effective-address-simple/index"/imm32
2794 68/push 4/imm32/none
2795 51/push-ecx
2796
2797 e8/call check-ints-equal/disp32
2798
2799 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2800
2801
2802 68/push "F - test-parse-effective-address-simple/scale"/imm32
2803 68/push 0/imm32/none
2804 52/push-edx
2805
2806 e8/call check-ints-equal/disp32
2807
2808 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2809
2810
2811 68/push "F - test-parse-effective-address-simple/displacement"/imm32
2812 68/push 0/imm32/none
2813 53/push-ebx
2814
2815 e8/call check-ints-equal/disp32
2816
2817 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2818
2819 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2820 5d/pop-to-ebp
2821 c3/return
2822
2823 test-parse-effective-address-base:
2824
2825 55/push-ebp
2826 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2827
2828 b8/copy-to-eax "*(esi )"/imm32
2829 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2830 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2831 05/add-to-eax 4/imm32
2832
2833 51/push-ecx
2834 50/push-eax
2835 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2836
2837
2838 51/push-ecx
2839
2840 e8/call parse-effective-address/disp32
2841
2842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2843
2844
2845
2846 68/push "F - test-parse-effective-address-base/base"/imm32
2847 68/push 6/imm32/esi
2848 50/push-eax
2849
2850 e8/call check-ints-equal/disp32
2851
2852 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2853
2854
2855 68/push "F - test-parse-effective-address-base/index"/imm32
2856 68/push 4/imm32/none
2857 51/push-ecx
2858
2859 e8/call check-ints-equal/disp32
2860
2861 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2862
2863
2864 68/push "F - test-parse-effective-address-base/scale"/imm32
2865 68/push 0/imm32/none
2866 52/push-edx
2867
2868 e8/call check-ints-equal/disp32
2869
2870 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2871
2872
2873 68/push "F - test-parse-effective-address-base/displacement"/imm32
2874 68/push 0/imm32/none
2875 53/push-ebx
2876
2877 e8/call check-ints-equal/disp32
2878
2879 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2880
2881 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2882 5d/pop-to-ebp
2883 c3/return
2884
2885 test-parse-effective-address-base-displacement:
2886
2887 55/push-ebp
2888 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2889
2890 b8/copy-to-eax "*(esi+3)"/imm32
2891 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2892 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2893 05/add-to-eax 4/imm32
2894
2895 51/push-ecx
2896 50/push-eax
2897 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2898
2899
2900 51/push-ecx
2901
2902 e8/call parse-effective-address/disp32
2903
2904 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2905
2906
2907
2908 68/push "F - test-parse-effective-address-base-displacement/base"/imm32
2909 68/push 6/imm32/esi
2910 50/push-eax
2911
2912 e8/call check-ints-equal/disp32
2913
2914 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2915
2916
2917 68/push "F - test-parse-effective-address-base-displacement/index"/imm32
2918 68/push 4/imm32/none
2919 51/push-ecx
2920
2921 e8/call check-ints-equal/disp32
2922
2923 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2924
2925
2926 68/push "F - test-parse-effective-address-base-displacement/scale"/imm32
2927 68/push 0/imm32/none
2928 52/push-edx
2929
2930 e8/call check-ints-equal/disp32
2931
2932 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2933
2934
2935 68/push "F - test-parse-effective-address-base-displacement/displacement"/imm32
2936 68/push 3/imm32
2937 53/push-ebx
2938
2939 e8/call check-ints-equal/disp32
2940
2941 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2942
2943 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2944 5d/pop-to-ebp
2945 c3/return
2946
2947 test-parse-effective-address-base-negative-displacement:
2948
2949 55/push-ebp
2950 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2951
2952 b8/copy-to-eax "*(esi-3)"/imm32
2953 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2954 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2955 05/add-to-eax 4/imm32
2956
2957 51/push-ecx
2958 50/push-eax
2959 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2960
2961
2962 51/push-ecx
2963
2964 e8/call parse-effective-address/disp32
2965
2966 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2967
2968
2969
2970 68/push "F - test-parse-effective-address-base-negative-displacement/base"/imm32
2971 68/push 6/imm32/esi
2972 50/push-eax
2973
2974 e8/call check-ints-equal/disp32
2975
2976 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2977
2978
2979 68/push "F - test-parse-effective-address-base-negative-displacement/index"/imm32
2980 68/push 4/imm32/none
2981 51/push-ecx
2982
2983 e8/call check-ints-equal/disp32
2984
2985 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2986
2987
2988 68/push "F - test-parse-effective-address-base-negative-displacement/scale"/imm32
2989 68/push 0/imm32/none
2990 52/push-edx
2991
2992 e8/call check-ints-equal/disp32
2993
2994 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2995
2996
2997 68/push "F - test-parse-effective-address-base-negative-displacement/displacement"/imm32
2998 68/push -3/imm32
2999 53/push-ebx
3000
3001 e8/call check-ints-equal/disp32
3002
3003 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3004
3005 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3006 5d/pop-to-ebp
3007 c3/return
3008
3009 test-parse-effective-address-base-index:
3010
3011 55/push-ebp
3012 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3013
3014 b8/copy-to-eax "*(esi+ecx)"/imm32
3015 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
3016 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
3017 05/add-to-eax 4/imm32
3018
3019 51/push-ecx
3020 50/push-eax
3021 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3022
3023
3024 51/push-ecx
3025
3026 e8/call parse-effective-address/disp32
3027
3028 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3029
3030
3031
3032 68/push "F - test-parse-effective-address-base-index/base"/imm32
3033 68/push 6/imm32/esi
3034 50/push-eax
3035
3036 e8/call check-ints-equal/disp32
3037
3038 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3039
3040
3041 68/push "F - test-parse-effective-address-base-index/index"/imm32
3042 68/push 1/imm32/none
3043 51/push-ecx
3044
3045 e8/call check-ints-equal/disp32
3046
3047 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3048
3049
3050 68/push "F - test-parse-effective-address-base-index/scale"/imm32
3051 68/push 0/imm32/none
3052 52/push-edx
3053
3054 e8/call check-ints-equal/disp32
3055
3056 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3057
3058
3059 68/push "F - test-parse-effective-address-base-index/displacement"/imm32
3060 68/push 0/imm32
3061 53/push-ebx
3062
3063 e8/call check-ints-equal/disp32
3064
3065 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3066
3067 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3068 5d/pop-to-ebp
3069 c3/return
3070
3071 test-parse-effective-address-base-index-scale:
3072
3073 55/push-ebp
3074 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3075
3076 b8/copy-to-eax "*(esi+ecx<<2)"/imm32
3077 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
3078 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
3079 05/add-to-eax 4/imm32
3080
3081 51/push-ecx
3082 50/push-eax
3083 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3084
3085
3086 51/push-ecx
3087
3088 e8/call parse-effective-address/disp32
3089
3090 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3091
3092
3093
3094 68/push "F - test-parse-effective-address-base-index-scale/base"/imm32
3095 68/push 6/imm32/esi
3096 50/push-eax
3097
3098 e8/call check-ints-equal/disp32
3099
3100 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3101
3102
3103 68/push "F - test-parse-effective-address-base-index-scale/index"/imm32
3104 68/push 1/imm32/none
3105 51/push-ecx
3106
3107 e8/call check-ints-equal/disp32
3108
3109 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3110
3111
3112 68/push "F - test-parse-effective-address-base-index-scale/scale"/imm32
3113 68/push 2/imm32
3114 52/push-edx
3115
3116 e8/call check-ints-equal/disp32
3117
3118 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3119
3120
3121 68/push "F - test-parse-effective-address-base-index-scale/displacement"/imm32
3122 68/push 0/imm32
3123 53/push-ebx
3124
3125 e8/call check-ints-equal/disp32
3126
3127 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3128
3129 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3130 5d/pop-to-ebp
3131 c3/return
3132
3133 test-parse-effective-address-base-index-scale-displacement:
3134
3135 55/push-ebp
3136 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3137
3138 b8/copy-to-eax "*(esi + ecx<<2 - 0x34)"/imm32
3139 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
3140 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
3141 05/add-to-eax 4/imm32
3142
3143 51/push-ecx
3144 50/push-eax
3145 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3146
3147
3148 51/push-ecx
3149
3150 e8/call parse-effective-address/disp32
3151
3152 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3153
3154
3155
3156 68/push "F - test-parse-effective-address-base-index-scale/base"/imm32
3157 68/push 6/imm32/esi
3158 50/push-eax
3159
3160 e8/call check-ints-equal/disp32
3161
3162 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3163
3164
3165 68/push "F - test-parse-effective-address-base-index-scale/index"/imm32
3166 68/push 1/imm32/none
3167 51/push-ecx
3168
3169 e8/call check-ints-equal/disp32
3170
3171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3172
3173
3174 68/push "F - test-parse-effective-address-base-index-scale/scale"/imm32
3175 68/push 2/imm32
3176 52/push-edx
3177
3178 e8/call check-ints-equal/disp32
3179
3180 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3181
3182
3183 68/push "F - test-parse-effective-address-base-index-scale/displacement"/imm32
3184 68/push -0x34/imm32
3185 53/push-ebx
3186
3187 e8/call check-ints-equal/disp32
3188
3189 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3190
3191 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3192 5d/pop-to-ebp
3193 c3/return
3194
3195
3196
3197
3198
3199
3200
3201
3202 emit-indirect-mode:
3203
3204 55/push-ebp
3205 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3206 $emit-indirect-mode:check-for-ebp:
3207
3208 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 5/imm32
3209 74/jump-if-equal $emit-indirect-mode:emit-sib/disp8
3210 $emit-indirect-mode:check-for-esp:
3211
3212 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 4/imm32
3213 74/jump-if-equal $emit-indirect-mode:emit-sib/disp8
3214 $emit-indirect-mode:check-for-sib:
3215
3216 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 4/imm32
3217 0f 84/jump-if-equal $emit-indirect-mode:check-for-disp/disp32
3218 $emit-indirect-mode:emit-sib:
3219
3220
3221
3222 68/push "2/mod/*+disp32 4/rm32/sib "/imm32
3223 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3224
3225 e8/call write-buffered/disp32
3226
3227 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3228
3229
3230 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3231 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3232
3233 e8/call print-int32-buffered/disp32
3234
3235 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3236
3237
3238 68/push "/base "/imm32
3239 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3240
3241 e8/call write-buffered/disp32
3242
3243 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3244
3245
3246 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
3247 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3248
3249 e8/call print-int32-buffered/disp32
3250
3251 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3252
3253
3254 68/push "/index "/imm32
3255 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3256
3257 e8/call write-buffered/disp32
3258
3259 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3260
3261
3262 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 .
3263 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3264
3265 e8/call print-int32-buffered/disp32
3266
3267 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3268
3269
3270 68/push "/scale "/imm32
3271 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3272
3273 e8/call write-buffered/disp32
3274
3275 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3276
3277
3278 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 .
3279 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3280
3281 e8/call print-int32-buffered/disp32
3282
3283 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3284
3285
3286 68/push "/disp32"/imm32
3287 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3288
3289 e8/call write-buffered/disp32
3290
3291 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3292 e9/jump $emit-indirect-mode:end/disp32
3293 $emit-indirect-mode:check-for-disp:
3294
3295 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 0/imm32
3296 74/jump-if-equal $emit-indirect-mode:emit-indirect/disp8
3297 $emit-indirect-mode:emit-disp:
3298
3299
3300
3301 68/push "2/mod/*+disp32 "/imm32
3302 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3303
3304 e8/call write-buffered/disp32
3305
3306 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3307
3308
3309 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3310 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3311
3312 e8/call print-int32-buffered/disp32
3313
3314 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3315
3316
3317 68/push "/rm32 "/imm32
3318 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3319
3320 e8/call write-buffered/disp32
3321
3322 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3323
3324
3325 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 .
3326 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3327
3328 e8/call print-int32-buffered/disp32
3329
3330 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3331
3332
3333 68/push "/disp32"/imm32
3334 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3335
3336 e8/call write-buffered/disp32
3337
3338 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3339 eb/jump $emit-indirect-mode:end/disp8
3340 $emit-indirect-mode:emit-indirect:
3341
3342
3343
3344 68/push "0/mod/indirect "/imm32
3345 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3346
3347 e8/call write-buffered/disp32
3348
3349 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3350
3351
3352 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3353 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3354
3355 e8/call print-int32-buffered/disp32
3356
3357 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3358
3359
3360 68/push "/rm32"/imm32
3361 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3362
3363 e8/call write-buffered/disp32
3364
3365 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3366 $emit-indirect-mode:end:
3367
3368 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3369 5d/pop-to-ebp
3370 c3/return
3371
3372 test-emit-indirect-mode:
3373
3374 55/push-ebp
3375 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3376
3377
3378
3379 68/push _test-output-stream/imm32
3380
3381 e8/call clear-stream/disp32
3382
3383 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3384
3385
3386 b8/copy-to-eax _test-output-buffered-file/imm32
3387 05/add-to-eax 4/imm32
3388 50/push-eax
3389
3390 e8/call clear-stream/disp32
3391
3392 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3393
3394
3395 68/push 0/imm32/.disp
3396 68/push 0/imm32/.scale
3397 68/push 4/imm32/.index/none
3398 68/push 0/imm32/.base
3399 68/push _test-output-buffered-file/imm32
3400
3401 e8/call emit-indirect-mode/disp32
3402
3403 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3404
3405
3406 68/push _test-output-buffered-file/imm32
3407
3408 e8/call flush/disp32
3409
3410 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3411 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3437
3438
3439 68/push "F - test-emit-indirect-mode"/imm32
3440 68/push "0/mod/indirect 0x00000000/rm32"/imm32
3441 68/push _test-output-stream/imm32
3442
3443 e8/call check-stream-equal/disp32
3444
3445 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3446
3447 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3448 5d/pop-to-ebp
3449 c3/return
3450
3451 test-emit-indirect-mode-2:
3452
3453 55/push-ebp
3454 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3455
3456
3457
3458 68/push _test-output-stream/imm32
3459
3460 e8/call clear-stream/disp32
3461
3462 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3463
3464
3465 b8/copy-to-eax _test-output-buffered-file/imm32
3466 05/add-to-eax 4/imm32
3467 50/push-eax
3468
3469 e8/call clear-stream/disp32
3470
3471 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3472
3473
3474 68/push 0/imm32/.disp
3475 68/push 0/imm32/.scale
3476 68/push 4/imm32/.index/none
3477 68/push 7/imm32/.base
3478 68/push _test-output-buffered-file/imm32
3479
3480 e8/call emit-indirect-mode/disp32
3481
3482 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3483
3484
3485 68/push _test-output-buffered-file/imm32
3486
3487 e8/call flush/disp32
3488
3489 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3490 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3516
3517
3518 68/push "F - test-emit-indirect-mode-2"/imm32
3519 68/push "0/mod/indirect 0x00000007/rm32"/imm32
3520 68/push _test-output-stream/imm32
3521
3522 e8/call check-stream-equal/disp32
3523
3524 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3525
3526 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3527 5d/pop-to-ebp
3528 c3/return
3529
3530 test-emit-indirect-mode-with-disp:
3531
3532 55/push-ebp
3533 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3534
3535
3536
3537 68/push _test-output-stream/imm32
3538
3539 e8/call clear-stream/disp32
3540
3541 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3542
3543
3544 b8/copy-to-eax _test-output-buffered-file/imm32
3545 05/add-to-eax 4/imm32
3546 50/push-eax
3547
3548 e8/call clear-stream/disp32
3549
3550 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3551
3552
3553 68/push 4/imm32/.disp
3554 68/push 0/imm32/.scale
3555 68/push 4/imm32/.index/none
3556 68/push 6/imm32/.base
3557 68/push _test-output-buffered-file/imm32
3558
3559 e8/call emit-indirect-mode/disp32
3560
3561 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3562
3563
3564 68/push _test-output-buffered-file/imm32
3565
3566 e8/call flush/disp32
3567
3568 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3569 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3595
3596
3597 68/push "F - test-emit-indirect-mode-with-disp"/imm32
3598 68/push "2/mod/*+disp32 0x00000006/rm32 0x00000004/disp32"/imm32
3599 68/push _test-output-stream/imm32
3600
3601 e8/call check-stream-equal/disp32
3602
3603 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3604
3605 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3606 5d/pop-to-ebp
3607 c3/return
3608
3609 test-emit-indirect-mode-with-disp-negative:
3610
3611 55/push-ebp
3612 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3613
3614
3615
3616 68/push _test-output-stream/imm32
3617
3618 e8/call clear-stream/disp32
3619
3620 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3621
3622
3623 b8/copy-to-eax _test-output-buffered-file/imm32
3624 05/add-to-eax 4/imm32
3625 50/push-eax
3626
3627 e8/call clear-stream/disp32
3628
3629 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3630
3631
3632 68/push -4/imm32/.disp
3633 68/push 0/imm32/.scale
3634 68/push 4/imm32/.index/none
3635 68/push 6/imm32/.base
3636 68/push _test-output-buffered-file/imm32
3637
3638 e8/call emit-indirect-mode/disp32
3639
3640 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3641
3642
3643 68/push _test-output-buffered-file/imm32
3644
3645 e8/call flush/disp32
3646
3647 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3648 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3674
3675
3676 68/push "F - test-emit-indirect-mode-with-disp"/imm32
3677 68/push "2/mod/*+disp32 0x00000006/rm32 0xfffffffc/disp32"/imm32
3678 68/push _test-output-stream/imm32
3679
3680 e8/call check-stream-equal/disp32
3681
3682 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3683
3684 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3685 5d/pop-to-ebp
3686 c3/return
3687
3688 test-emit-indirect-mode-with-sib:
3689
3690 55/push-ebp
3691 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3692
3693
3694
3695 68/push _test-output-stream/imm32
3696
3697 e8/call clear-stream/disp32
3698
3699 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3700
3701
3702 b8/copy-to-eax _test-output-buffered-file/imm32
3703 05/add-to-eax 4/imm32
3704 50/push-eax
3705
3706 e8/call clear-stream/disp32
3707
3708 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3709
3710
3711 68/push 4/imm32/.disp
3712 68/push 2/imm32/.scale
3713 68/push 1/imm32/.index
3714 68/push 6/imm32/.base
3715 68/push _test-output-buffered-file/imm32
3716
3717 e8/call emit-indirect-mode/disp32
3718
3719 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3720
3721
3722 68/push _test-output-buffered-file/imm32
3723
3724 e8/call flush/disp32
3725
3726 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3727 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3753
3754
3755 68/push "F - test-emit-indirect-mode-with-sib"/imm32
3756 68/push "2/mod/*+disp32 4/rm32/sib 0x00000006/base 0x00000001/index 0x00000002/scale 0x00000004/disp32"/imm32
3757 68/push _test-output-stream/imm32
3758
3759 e8/call check-stream-equal/disp32
3760
3761 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3762
3763 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3764 5d/pop-to-ebp
3765 c3/return
3766
3767 test-emit-indirect-mode-ebp:
3768
3769 55/push-ebp
3770 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3771
3772
3773
3774 68/push _test-output-stream/imm32
3775
3776 e8/call clear-stream/disp32
3777
3778 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3779
3780
3781 b8/copy-to-eax _test-output-buffered-file/imm32
3782 05/add-to-eax 4/imm32
3783 50/push-eax
3784
3785 e8/call clear-stream/disp32
3786
3787 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3788
3789
3790 68/push 0/imm32/.disp
3791 68/push 0/imm32/.scale
3792 68/push 0/imm32/.index
3793 68/push 5/imm32/.base/ebp
3794 68/push _test-output-buffered-file/imm32
3795
3796 e8/call emit-indirect-mode/disp32
3797
3798 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3799
3800
3801 68/push _test-output-buffered-file/imm32
3802
3803 e8/call flush/disp32
3804
3805 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3806 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3832
3833
3834 68/push "F - test-emit-indirect-mode-ebp"/imm32
3835 68/push "2/mod/*+disp32 4/rm32/sib 0x00000005/base 0x00000000/index 0x00000000/scale 0x00000000/disp32"/imm32
3836 68/push _test-output-stream/imm32
3837
3838 e8/call check-stream-equal/disp32
3839
3840 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3841
3842 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3843 5d/pop-to-ebp
3844 c3/return
3845
3846 test-emit-indirect-mode-esp:
3847
3848 55/push-ebp
3849 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3850
3851
3852
3853 68/push _test-output-stream/imm32
3854
3855 e8/call clear-stream/disp32
3856
3857 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3858
3859
3860 b8/copy-to-eax _test-output-buffered-file/imm32
3861 05/add-to-eax 4/imm32
3862 50/push-eax
3863
3864 e8/call clear-stream/disp32
3865
3866 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3867
3868
3869 68/push 0/imm32/.disp
3870 68/push 0/imm32/.scale
3871 68/push 0/imm32/.index
3872 68/push 4/imm32/.base/esp
3873 68/push _test-output-buffered-file/imm32
3874
3875 e8/call emit-indirect-mode/disp32
3876
3877 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3878
3879
3880 68/push _test-output-buffered-file/imm32
3881
3882 e8/call flush/disp32
3883
3884 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3885 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3911
3912
3913 68/push "F - test-emit-indirect-mode-esp"/imm32
3914 68/push "2/mod/*+disp32 4/rm32/sib 0x00000004/base 0x00000000/index 0x00000000/scale 0x00000000/disp32"/imm32
3915 68/push _test-output-stream/imm32
3916
3917 e8/call check-stream-equal/disp32
3918
3919 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3920
3921 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3922 5d/pop-to-ebp
3923 c3/return
3924
3925 disp32-mode?:
3926
3927 55/push-ebp
3928 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3929
3930 56/push-esi
3931 57/push-edi
3932
3933 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
3934 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
3935 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
3936 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
3937
3938 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
3939
3940 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
3941 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
3942 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
3943 3d/compare-eax-and 0x28/imm32/open-paren
3944 74/jump-if-equal $disp32-mode?:false/disp8
3945 $disp32-mode?:check-for-register:
3946
3947
3948 56/push-esi
3949 68/push 0x2f/imm32/slash
3950 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
3951 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
3952
3953 e8/call next-token-from-slice/disp32
3954
3955 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
3956
3957
3958 68/push 8/imm32/row-size
3959 56/push-esi
3960 68/push Registers/imm32
3961
3962 e8/call maybe-get-slice/disp32
3963
3964 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3965
3966 3d/compare-eax-and 0/imm32
3967 75/jump-if-not-equal $disp32-mode?:false/disp8
3968
3969 b8/copy-to-eax 1/imm32/true
3970 eb/jump $disp32-mode?:end/disp8
3971 $disp32-mode?:false:
3972 b8/copy-to-eax 0/imm32/false
3973 $disp32-mode?:end:
3974
3975 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3976
3977 5f/pop-to-edi
3978 5e/pop-to-esi
3979
3980 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3981 5d/pop-to-ebp
3982 c3/return
3983
3984 emit-indirect-disp32:
3985
3986 55/push-ebp
3987 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3988
3989 56/push-esi
3990
3991 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 .
3992 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
3993 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
3994 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
3995
3996 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
3997
3998
3999 68/push "0/mod/indirect 5/rm32/.disp32 "/imm32
4000 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
4001
4002 e8/call write-buffered/disp32
4003
4004 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4005
4006
4007 56/push-esi
4008 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
4009
4010 e8/call write-slice-buffered/disp32
4011
4012 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4013
4014
4015 68/push "/disp32"/imm32
4016 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
4017
4018 e8/call write-buffered/disp32
4019
4020 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4021 $emit-indirect-disp32:end:
4022
4023 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4024
4025 5e/pop-to-esi
4026
4027 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4028 5d/pop-to-ebp
4029 c3/return
4030
4031
4032
4033
4034 next-hex-int:
4035
4036 55/push-ebp
4037 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4038
4039 51/push-ecx
4040 52/push-edx
4041 53/push-ebx
4042 56/push-esi
4043 57/push-edi
4044
4045 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
4046
4047 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
4048
4049 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 4/disp8 .
4050
4051 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
4052
4053 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
4054
4055 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4056 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4057 $next-hex-int:positive:
4058
4059 3d/compare-eax-and 0x2b/imm32/+
4060 75/jump-if-not-equal $next-hex-int:negative/disp8
4061
4062 41/increment-ecx
4063 eb/jump $next-hex-int:skip-whitespace/disp8
4064 $next-hex-int:negative:
4065
4066 3d/compare-eax-and 0x2d/imm32/-
4067 75/jump-if-not-equal $next-hex-int:skip-whitespace/disp8
4068 $next-hex-int:need-to-negate:
4069
4070 41/increment-ecx
4071
4072 bb/copy-to-ebx 1/imm32/true
4073
4074 $next-hex-int:skip-whitespace:
4075
4076 50/push-eax
4077
4078
4079 52/push-edx
4080 51/push-ecx
4081
4082 e8/call skip-chars-matching-whitespace-in-slice/disp32
4083
4084 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4085
4086 89/copy 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . .
4087
4088 58/pop-to-eax
4089 $next-hex-int:initial-0:
4090
4091
4092 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4093 3d/compare-eax-and 0x30/imm32/0
4094 75/jump-if-not-equal $next-hex-int:loop/disp8
4095
4096 41/increment-ecx
4097 $next-hex-int:initial-0x:
4098
4099 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4100 73/jump-if-greater-or-equal-unsigned $next-hex-int:end/disp8
4101
4102 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4103 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4104 3d/compare-eax-and 0x78/imm32/x
4105 75/jump-if-not-equal $next-hex-int:loop/disp8
4106
4107 41/increment-ecx
4108 $next-hex-int:loop:
4109
4110 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4111 73/jump-if-greater-or-equal-unsigned $next-hex-int:break/disp8
4112
4113
4114 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4115
4116
4117 50/push-eax
4118
4119 e8/call is-hex-digit?/disp32
4120
4121 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4122
4123 3d/compare-eax-and 0/imm32
4124 74/jump-if-equal $next-hex-int:break/disp8
4125
4126
4127 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4128
4129 e8/call from-hex-char/disp32
4130
4131 c1/shift 4/subop/left 3/mod/direct 7/rm32/edi . . . . . 4/imm8
4132 01/add 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
4133
4134 41/increment-ecx
4135
4136 eb/jump $next-hex-int:loop/disp8
4137 $next-hex-int:break:
4138 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32
4139 74/jump-if-equal $next-hex-int:end/disp8
4140 $next-hex-int:negate:
4141 f7 3/subop/negate 3/mod/direct 7/rm32/edi . . . . . .
4142 $next-hex-int:end:
4143
4144 89/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
4145
4146 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . .
4147
4148 5f/pop-to-edi
4149 5e/pop-to-esi
4150 5b/pop-to-ebx
4151 5a/pop-to-edx
4152 59/pop-to-ecx
4153
4154 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4155 5d/pop-to-ebp
4156 c3/return
4157
4158 $next-hex-int:abort:
4159
4160
4161 68/push "next-hex-int: invalid hex char: "/imm32
4162 68/push 2/imm32/stderr
4163
4164 e8/call _write/disp32
4165
4166 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4167
4168
4169 50/push-eax
4170
4171 b8/copy-to-eax Stderr/imm32
4172 05/add-to-eax 4/imm32
4173 50/push-eax
4174
4175 e8/call clear-stream/disp32
4176
4177 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4178
4179 58/pop-to-eax
4180
4181
4182 50/push-eax
4183 68/push Stderr/imm32
4184
4185 e8/call print-int32-buffered/disp32
4186
4187 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4188
4189
4190 68/push Stderr/imm32
4191
4192 e8/call flush/disp32
4193
4194 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4195
4196
4197 68/push "\n"/imm32
4198 68/push 2/imm32/stderr
4199
4200 e8/call _write/disp32
4201
4202 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4203
4204 bb/copy-to-ebx 1/imm32
4205 b8/copy-to-eax 1/imm32/exit
4206 cd/syscall 0x80/imm8
4207
4208
4209 test-next-hex-int-single-digit:
4210
4211 55/push-ebp
4212 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4213
4214 b8/copy-to-eax "+a)"/imm32
4215 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4216 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4217 05/add-to-eax 4/imm32
4218
4219 51/push-ecx
4220 50/push-eax
4221 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4222
4223
4224 51/push-ecx
4225
4226 e8/call next-hex-int/disp32
4227
4228 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4229
4230
4231 68/push "F - test-next-hex-int-single-digit"/imm32
4232 68/push 0xa/imm32
4233 50/push-eax
4234
4235 e8/call check-ints-equal/disp32
4236
4237 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4238
4239 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4240 5d/pop-to-ebp
4241 c3/return
4242
4243 test-next-hex-int-multi-digit:
4244
4245 55/push-ebp
4246 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4247
4248 b8/copy-to-eax "+ 34a)"/imm32
4249 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4250 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4251 05/add-to-eax 4/imm32
4252
4253 51/push-ecx
4254 50/push-eax
4255 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4256
4257
4258 51/push-ecx
4259
4260 e8/call next-hex-int/disp32
4261
4262 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4263
4264
4265 68/push "F - test-next-hex-int-multi-digit"/imm32
4266 68/push 0x34a/imm32
4267 50/push-eax
4268
4269 e8/call check-ints-equal/disp32
4270
4271 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4272
4273 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4274 5d/pop-to-ebp
4275 c3/return
4276
4277 test-next-hex-int-0x-prefix:
4278
4279 55/push-ebp
4280 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4281
4282 b8/copy-to-eax "+0x34)"/imm32
4283 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4284 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4285 05/add-to-eax 4/imm32
4286
4287 51/push-ecx
4288 50/push-eax
4289 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4290
4291
4292 51/push-ecx
4293
4294 e8/call next-hex-int/disp32
4295
4296 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4297
4298
4299 68/push "F - test-next-hex-int-0x-prefix"/imm32
4300 68/push 0x34/imm32
4301 50/push-eax
4302
4303 e8/call check-ints-equal/disp32
4304
4305 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4306
4307 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4308 5d/pop-to-ebp
4309 c3/return
4310
4311 test-next-hex-int-zero:
4312
4313 55/push-ebp
4314 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4315
4316 b8/copy-to-eax "+0)"/imm32
4317 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4318 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4319 05/add-to-eax 4/imm32
4320
4321 51/push-ecx
4322 50/push-eax
4323 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4324
4325
4326 51/push-ecx
4327
4328 e8/call next-hex-int/disp32
4329
4330 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4331
4332
4333 68/push "F - test-next-hex-int-zero"/imm32
4334 68/push 0/imm32
4335 50/push-eax
4336
4337 e8/call check-ints-equal/disp32
4338
4339 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4340
4341 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4342 5d/pop-to-ebp
4343 c3/return
4344
4345 test-next-hex-int-0-prefix:
4346
4347 55/push-ebp
4348 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4349
4350 b8/copy-to-eax "+ 03)"/imm32
4351 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4352 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4353 05/add-to-eax 4/imm32
4354
4355 51/push-ecx
4356 50/push-eax
4357 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4358
4359
4360 51/push-ecx
4361
4362 e8/call next-hex-int/disp32
4363
4364 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4365
4366
4367 68/push "F - test-next-hex-int-0-prefix"/imm32
4368 68/push 3/imm32
4369 50/push-eax
4370
4371 e8/call check-ints-equal/disp32
4372
4373 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4374
4375 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4376 5d/pop-to-ebp
4377 c3/return
4378
4379 test-next-hex-int-negative:
4380
4381 55/push-ebp
4382 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4383
4384 b8/copy-to-eax "-03)"/imm32
4385 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4386 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4387 05/add-to-eax 4/imm32
4388
4389 51/push-ecx
4390 50/push-eax
4391 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4392
4393
4394 51/push-ecx
4395
4396 e8/call next-hex-int/disp32
4397
4398 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4399
4400
4401 68/push "F - test-next-hex-int-negative"/imm32
4402 68/push -3/imm32
4403 50/push-eax
4404
4405 e8/call check-ints-equal/disp32
4406
4407 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4408
4409 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4410 5d/pop-to-ebp
4411 c3/return
4412
4413 test-next-hex-int-negative-with-space:
4414
4415 55/push-ebp
4416 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4417
4418 b8/copy-to-eax "- 03)"/imm32
4419 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4420 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4421 05/add-to-eax 4/imm32
4422
4423 51/push-ecx
4424 50/push-eax
4425 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4426
4427
4428 51/push-ecx
4429
4430 e8/call next-hex-int/disp32
4431
4432 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4433
4434
4435 68/push "F - test-next-hex-int-negative-with-space"/imm32
4436 68/push -3/imm32
4437 50/push-eax
4438
4439 e8/call check-ints-equal/disp32
4440
4441 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4442
4443 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4444 5d/pop-to-ebp
4445 c3/return
4446
4447
4448
4449
4450 next-positive-hex-int:
4451
4452 55/push-ebp
4453 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4454
4455 51/push-ecx
4456 52/push-edx
4457 53/push-ebx
4458 56/push-esi
4459 57/push-edi
4460
4461 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
4462
4463 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
4464
4465 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 4/disp8 .
4466
4467 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
4468
4469 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
4470
4471 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4472 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4473 $next-positive-hex-int:initial-0:
4474
4475
4476 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4477 3d/compare-eax-and 0x30/imm32/0
4478 75/jump-if-not-equal $next-positive-hex-int:loop/disp8
4479
4480 41/increment-ecx
4481 $next-positive-hex-int:initial-0x:
4482
4483 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4484 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8
4485
4486 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4487 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4488 3d/compare-eax-and 0x78/imm32/x
4489 75/jump-if-not-equal $next-positive-hex-int:loop/disp8
4490
4491 41/increment-ecx
4492 $next-positive-hex-int:loop:
4493
4494 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4495 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8
4496
4497
4498 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4499
4500
4501 50/push-eax
4502
4503 e8/call is-hex-digit?/disp32
4504
4505 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4506
4507 3d/compare-eax-and 0/imm32
4508 74/jump-if-equal $next-positive-hex-int:end/disp8
4509
4510
4511 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4512
4513 e8/call from-hex-char/disp32
4514
4515 c1/shift 4/subop/left 3/mod/direct 7/rm32/edi . . . . . 4/imm8
4516 01/add 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
4517
4518 41/increment-ecx
4519
4520 eb/jump $next-positive-hex-int:loop/disp8
4521 $next-positive-hex-int:end:
4522
4523 89/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
4524
4525 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . .
4526
4527 5f/pop-to-edi
4528 5e/pop-to-esi
4529 5b/pop-to-ebx
4530 5a/pop-to-edx
4531 59/pop-to-ecx
4532
4533 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4534 5d/pop-to-ebp
4535 c3/return
4536
4537 test-next-positive-hex-int-single-digit:
4538
4539 55/push-ebp
4540 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4541
4542 b8/copy-to-eax "a)"/imm32
4543 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4544 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4545 05/add-to-eax 4/imm32
4546
4547 51/push-ecx
4548 50/push-eax
4549 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4550
4551
4552 51/push-ecx
4553
4554 e8/call next-positive-hex-int/disp32
4555
4556 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4557
4558
4559 68/push "F - test-next-positive-hex-int-single-digit"/imm32
4560 68/push 0xa/imm32
4561 50/push-eax
4562
4563 e8/call check-ints-equal/disp32
4564
4565 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4566
4567 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4568 5d/pop-to-ebp
4569 c3/return
4570
4571 test-next-positive-hex-int-multi-digit:
4572
4573 55/push-ebp
4574 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4575
4576 b8/copy-to-eax "34a)"/imm32
4577 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4578 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4579 05/add-to-eax 4/imm32
4580
4581 51/push-ecx
4582 50/push-eax
4583 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4584
4585
4586 51/push-ecx
4587
4588 e8/call next-positive-hex-int/disp32
4589
4590 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4591
4592
4593 68/push "F - test-next-positive-hex-int-multi-digit"/imm32
4594 68/push 0x34a/imm32
4595 50/push-eax
4596
4597 e8/call check-ints-equal/disp32
4598
4599 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4600
4601 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4602 5d/pop-to-ebp
4603 c3/return
4604
4605 test-next-positive-hex-int-0x-prefix:
4606
4607 55/push-ebp
4608 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4609
4610 b8/copy-to-eax "0x34)"/imm32
4611 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4612 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4613 05/add-to-eax 4/imm32
4614
4615 51/push-ecx
4616 50/push-eax
4617 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4618
4619
4620 51/push-ecx
4621
4622 e8/call next-positive-hex-int/disp32
4623
4624 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4625
4626
4627 68/push "F - test-next-positive-hex-int-0x-prefix"/imm32
4628 68/push 0x34/imm32
4629 50/push-eax
4630
4631 e8/call check-ints-equal/disp32
4632
4633 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4634
4635 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4636 5d/pop-to-ebp
4637 c3/return
4638
4639 test-next-positive-hex-int-zero:
4640
4641 55/push-ebp
4642 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4643
4644 b8/copy-to-eax "0"/imm32
4645 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4646 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4647 05/add-to-eax 4/imm32
4648
4649 51/push-ecx
4650 50/push-eax
4651 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4652
4653
4654 51/push-ecx
4655
4656 e8/call next-positive-hex-int/disp32
4657
4658 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4659
4660
4661 68/push "F - test-next-positive-hex-int-zero"/imm32
4662 68/push 0/imm32
4663 50/push-eax
4664
4665 e8/call check-ints-equal/disp32
4666
4667 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4668
4669 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4670 5d/pop-to-ebp
4671 c3/return
4672
4673 test-next-positive-hex-int-0-prefix:
4674
4675 55/push-ebp
4676 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4677
4678 b8/copy-to-eax "03)"/imm32
4679 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4680 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4681 05/add-to-eax 4/imm32
4682
4683 51/push-ecx
4684 50/push-eax
4685 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4686
4687
4688 51/push-ecx
4689
4690 e8/call next-positive-hex-int/disp32
4691
4692 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4693
4694
4695 68/push "F - test-next-positive-hex-int-0-prefix"/imm32
4696 68/push 3/imm32
4697 50/push-eax
4698
4699 e8/call check-ints-equal/disp32
4700
4701 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4702
4703 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4704 5d/pop-to-ebp
4705 c3/return
4706
4707 == data
4708 Registers:
4709
4710 0x40/imm32/write
4711 0/imm32/read
4712 0x40/imm32/length
4713
4714 "eax"/imm32 0/imm32
4715 "ecx"/imm32 1/imm32
4716 "edx"/imm32 2/imm32
4717 "ebx"/imm32 3/imm32
4718 "esp"/imm32 4/imm32
4719 "ebp"/imm32 5/imm32
4720 "esi"/imm32 6/imm32
4721 "edi"/imm32 7/imm32
4722
4723