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 55/push-ebp
1655 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1656
1657 50/push-eax
1658 51/push-ecx
1659 56/push-esi
1660 57/push-edi
1661
1662 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
1663
1664 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 7/r32/edi 0xc/disp8 .
1665
1666
1667 68/push 0x20/imm32/space
1668 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1669
1670 e8/call skip-chars-matching/disp32
1671
1672 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1673 $next-word-or-expression:check0:
1674
1675
1676 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 4/disp8 .
1677
1678 3b/compare 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
1679 7c/jump-if-lesser $next-word-or-expression:check-for-comment/disp8
1680
1681 c7 0/subop/copy 0/mod/direct 7/rm32/edi . . . . . 0/imm32
1682 c7 0/subop/copy 1/mod/*+disp8 7/rm32/edi . . . . 4/disp8 0/imm32
1683 e9/jump $next-word-or-expression:end/disp32
1684 $next-word-or-expression:check-for-comment:
1685
1686 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 .
1687 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/eax 0xc/disp8 .
1688 89/copy 0/mod/indirect 7/rm32/edi . . . 0/r32/eax . .
1689
1690
1691 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1692 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xc/disp8 .
1693
1694 3d/compare-eax-and 0x23/imm32/pound
1695 75/jump-if-not-equal $next-word-or-expression:check-for-string-literal/disp8
1696 $next-word-or-expression:comment:
1697
1698 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
1699 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax . 0/r32/eax 0xc/disp8 .
1700 89/copy 1/mod/*+disp8 7/rm32/edi . . . 0/r32/eax 4/disp8 .
1701
1702 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
1703 89/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 4/disp8 .
1704
1705 eb/jump $next-word-or-expression:end/disp8
1706 $next-word-or-expression:check-for-string-literal:
1707
1708
1709 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1710 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xc/disp8 .
1711
1712 3d/compare-eax-and 0x22/imm32/dquote
1713 75/jump-if-not-equal $next-word-or-expression:check-for-paren/disp8
1714 $next-word-or-expression:string-literal:
1715
1716
1717 56/push-esi
1718
1719 e8/call skip-string/disp32
1720
1721 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1722
1723 eb/jump $next-word-or-expression:regular-word/disp8
1724 $next-word-or-expression:check-for-paren:
1725
1726
1727 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
1728 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xc/disp8 .
1729
1730 3d/compare-eax-and 0x2a/imm32/asterisk
1731 75/jump-if-not-equal $next-word-or-expression:regular-word/disp8
1732
1733 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xd/disp8 .
1734
1735 3d/compare-eax-and 0x20/imm32/space
1736 74/jump-if-equal $next-word-or-expression:error1/disp8
1737
1738 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xd/disp8 .
1739
1740 3d/compare-eax-and 0x28/imm32/open-paren
1741 75/jump-if-not-equal $next-word-or-expression:regular-word/disp8
1742 $next-word-or-expression:paren:
1743
1744
1745 56/push-esi
1746
1747 e8/call skip-until-close-paren/disp32
1748
1749 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1750
1751 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 .
1752 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xc/disp8 .
1753
1754 3d/compare-eax-and 0x29/imm32/close-paren
1755 75/jump-if-not-equal $next-word-or-expression:error2/disp8
1756
1757 ff 0/subop/increment 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
1758
1759 $next-word-or-expression:regular-word:
1760
1761
1762 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
1763
1764 e8/call skip-chars-not-matching-whitespace/disp32
1765
1766 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1767
1768 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 .
1769 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/eax 0xc/disp8 .
1770 89/copy 1/mod/*+disp8 7/rm32/edi . . . 0/r32/eax 4/disp8 .
1771 $next-word-or-expression:end:
1772
1773 5f/pop-to-edi
1774 5e/pop-to-esi
1775 59/pop-to-ecx
1776 58/pop-to-eax
1777
1778 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1779 5d/pop-to-ebp
1780 c3/return
1781
1782 $next-word-or-expression:error1:
1783
1784
1785
1786 68/push "error: no space allowed after '*' in '"/imm32
1787 68/push Stderr/imm32
1788
1789 e8/call write-buffered/disp32
1790
1791 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1792
1793
1794 56/push-esi
1795 68/push Stderr/imm32
1796
1797 e8/call write-stream-data/disp32
1798
1799 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1800
1801
1802 68/push "'"/imm32
1803 68/push Stderr/imm32
1804
1805 e8/call write-buffered/disp32
1806
1807 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1808
1809
1810 68/push Stderr/imm32
1811
1812 e8/call flush/disp32
1813
1814 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1815
1816 bb/copy-to-ebx 1/imm32
1817 b8/copy-to-eax 1/imm32/exit
1818 cd/syscall 0x80/imm8
1819
1820
1821 $next-word-or-expression:error2:
1822
1823
1824
1825 68/push "error: *(...) expression must be all on a single line in '"/imm32
1826 68/push Stderr/imm32
1827
1828 e8/call write-buffered/disp32
1829
1830 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1831
1832
1833 56/push-esi
1834 68/push Stderr/imm32
1835
1836 e8/call write-stream-data/disp32
1837
1838 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1839
1840
1841 68/push "'"/imm32
1842 68/push Stderr/imm32
1843
1844 e8/call write-buffered/disp32
1845
1846 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1847
1848
1849 68/push Stderr/imm32
1850
1851 e8/call flush/disp32
1852
1853 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1854
1855 bb/copy-to-ebx 1/imm32
1856 b8/copy-to-eax 1/imm32/exit
1857 cd/syscall 0x80/imm8
1858
1859
1860 test-next-word-or-expression:
1861
1862 55/push-ebp
1863 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1864
1865
1866
1867 68/push _test-input-stream/imm32
1868
1869 e8/call clear-stream/disp32
1870
1871 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1872
1873 68/push 0/imm32/end
1874 68/push 0/imm32/start
1875 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1876
1877
1878 68/push " ab"/imm32
1879 68/push _test-input-stream/imm32
1880
1881 e8/call write/disp32
1882
1883 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1884
1885
1886 51/push-ecx
1887 68/push _test-input-stream/imm32
1888
1889 e8/call next-word-or-expression/disp32
1890
1891 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1892
1893
1894 68/push "F - test-next-word-or-expression/updates-stream-read-correctly"/imm32
1895 68/push 4/imm32
1896 b8/copy-to-eax _test-input-stream/imm32
1897 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
1898
1899 e8/call check-ints-equal/disp32
1900
1901 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1902
1903
1904
1905 68/push "F - test-next-word-or-expression: start"/imm32
1906 68/push 0xe/imm32
1907
1908 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
1909 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
1910 50/push-eax
1911
1912 e8/call check-ints-equal/disp32
1913
1914 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1915
1916
1917
1918 68/push "F - test-next-word-or-expression: end"/imm32
1919 68/push 0x10/imm32
1920
1921 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
1922 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
1923 50/push-eax
1924
1925 e8/call check-ints-equal/disp32
1926
1927 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1928
1929 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
1930 5d/pop-to-ebp
1931 c3/return
1932
1933 test-next-word-or-expression-returns-whole-comment:
1934
1935 55/push-ebp
1936 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
1937
1938
1939
1940 68/push _test-input-stream/imm32
1941
1942 e8/call clear-stream/disp32
1943
1944 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
1945
1946 68/push 0/imm32/end
1947 68/push 0/imm32/start
1948 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
1949
1950
1951 68/push " # a"/imm32
1952 68/push _test-input-stream/imm32
1953
1954 e8/call write/disp32
1955
1956 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1957
1958
1959 51/push-ecx
1960 68/push _test-input-stream/imm32
1961
1962 e8/call next-word-or-expression/disp32
1963
1964 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
1965
1966
1967 68/push "F - test-next-word-or-expression-returns-whole-comment/updates-stream-read-correctly"/imm32
1968 68/push 5/imm32
1969 b8/copy-to-eax _test-input-stream/imm32
1970 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
1971
1972 e8/call check-ints-equal/disp32
1973
1974 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1975
1976
1977
1978 68/push "F - test-next-word-or-expression-returns-whole-comment: start"/imm32
1979 68/push 0xe/imm32
1980
1981 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
1982 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
1983 50/push-eax
1984
1985 e8/call check-ints-equal/disp32
1986
1987 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
1988
1989
1990
1991 68/push "F - test-next-word-or-expression-returns-whole-comment: end"/imm32
1992 68/push 0x11/imm32
1993
1994 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
1995 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
1996 50/push-eax
1997
1998 e8/call check-ints-equal/disp32
1999
2000 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2001
2002 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2003 5d/pop-to-ebp
2004 c3/return
2005
2006 test-next-word-or-expression-returns-empty-slice-on-eof:
2007
2008 55/push-ebp
2009 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2010
2011
2012
2013 68/push _test-input-stream/imm32
2014
2015 e8/call clear-stream/disp32
2016
2017 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2018
2019 68/push 0/imm32/end
2020 68/push 0/imm32/start
2021 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2022
2023
2024
2025 51/push-ecx
2026 68/push _test-input-stream/imm32
2027
2028 e8/call next-word-or-expression/disp32
2029
2030 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2031
2032
2033 68/push "F - test-next-word-or-expression-returns-empty-expression-on-eof"/imm32
2034 68/push 0/imm32
2035
2036 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2037 2b/subtract 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
2038 50/push-eax
2039
2040 e8/call check-ints-equal/disp32
2041
2042 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2043
2044 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2045 5d/pop-to-ebp
2046 c3/return
2047
2048 test-next-word-or-expression-returns-string-literal:
2049
2050 55/push-ebp
2051 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2052
2053
2054
2055 68/push _test-input-stream/imm32
2056
2057 e8/call clear-stream/disp32
2058
2059 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2060
2061 68/push 0/imm32/end
2062 68/push 0/imm32/start
2063 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2064
2065
2066 68/push " \"a b\"/imm32 "/imm32
2067 68/push _test-input-stream/imm32
2068
2069 e8/call write/disp32
2070
2071 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2072
2073
2074 51/push-ecx
2075 68/push _test-input-stream/imm32
2076
2077 e8/call next-word-or-expression/disp32
2078
2079 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2080
2081
2082
2083 68/push "F - test-next-word-or-expression-returns-string-literal: start"/imm32
2084 68/push 0xd/imm32
2085
2086 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
2087 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2088 50/push-eax
2089
2090 e8/call check-ints-equal/disp32
2091
2092 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2093
2094
2095
2096 68/push "F - test-next-word-or-expression-returns-string-literal: end"/imm32
2097 68/push 0x18/imm32
2098
2099 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2100 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2101 50/push-eax
2102
2103 e8/call check-ints-equal/disp32
2104
2105 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2106
2107 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2108 5d/pop-to-ebp
2109 c3/return
2110
2111 test-next-word-or-expression-returns-string-with-escapes:
2112
2113 55/push-ebp
2114 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2115
2116
2117
2118 68/push _test-input-stream/imm32
2119
2120 e8/call clear-stream/disp32
2121
2122 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2123
2124 68/push 0/imm32/end
2125 68/push 0/imm32/start
2126 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2127
2128
2129 68/push " \"a\\\"b\"/x"/imm32
2130 68/push _test-input-stream/imm32
2131
2132 e8/call write/disp32
2133
2134 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2135
2136
2137 51/push-ecx
2138 68/push _test-input-stream/imm32
2139
2140 e8/call next-word-or-expression/disp32
2141
2142 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2143
2144
2145
2146 68/push "F - test-next-word-or-expression-returns-string-with-escapes: start"/imm32
2147 68/push 0xd/imm32
2148
2149 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
2150 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2151 50/push-eax
2152
2153 e8/call check-ints-equal/disp32
2154
2155 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2156
2157
2158
2159 68/push "F - test-next-word-or-expression-returns-string-with-escapes: end"/imm32
2160 68/push 0x15/imm32
2161
2162 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2163 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2164 50/push-eax
2165
2166 e8/call check-ints-equal/disp32
2167
2168 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2169
2170 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2171 5d/pop-to-ebp
2172 c3/return
2173
2174 test-next-word-or-expression-returns-whole-expression:
2175
2176 55/push-ebp
2177 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2178
2179
2180
2181 68/push _test-input-stream/imm32
2182
2183 e8/call clear-stream/disp32
2184
2185 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2186
2187 68/push 0/imm32/end
2188 68/push 0/imm32/start
2189 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2190
2191
2192 68/push " *(a b)/imm32 "/imm32
2193 68/push _test-input-stream/imm32
2194
2195 e8/call write/disp32
2196
2197 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2198
2199
2200 51/push-ecx
2201 68/push _test-input-stream/imm32
2202
2203 e8/call next-word-or-expression/disp32
2204
2205 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2206
2207
2208
2209 68/push "F - test-next-word-or-expression-returns-whole-expression: start"/imm32
2210 68/push 0xd/imm32
2211
2212 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
2213 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2214 50/push-eax
2215
2216 e8/call check-ints-equal/disp32
2217
2218 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2219
2220
2221
2222 68/push "F - test-next-word-or-expression-returns-whole-expression: end"/imm32
2223 68/push 0x19/imm32
2224
2225 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 .
2226 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32
2227 50/push-eax
2228
2229 e8/call check-ints-equal/disp32
2230
2231 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2232
2233 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2234 5d/pop-to-ebp
2235 c3/return
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245 parse-effective-address:
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283 55/push-ebp
2284 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2285
2286 56/push-esi
2287 57/push-edi
2288
2289 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
2290 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2291 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2292 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
2293
2294 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2295
2296
2297 bf/copy-to-edi 0/imm32
2298 b9/copy-to-ecx 4/imm32/no-index
2299 ba/copy-to-edx 0/imm32/.scale
2300 bb/copy-to-ebx 0/imm32/disp
2301 $parse-effective-address:check-for-simple-register:
2302
2303 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2304 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2305 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2306 3d/compare-eax-and 0x28/imm32/open-paren
2307 74/jump-if-equal $parse-effective-address:compound-expression/disp8
2308 $parse-effective-address:simple-register:
2309
2310
2311 56/push-esi
2312 68/push 0x2f/imm32/slash
2313 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2314 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2315
2316 e8/call next-token-from-slice/disp32
2317
2318 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2319
2320
2321
2322 68/push "Registers"/imm32
2323 68/push 8/imm32/row-size
2324 56/push-esi
2325 68/push Registers/imm32
2326
2327 e8/call get-slice/disp32
2328
2329 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2330
2331 8b/copy 0/mod/indirect 0/rm32/eax . . . 7/r32/edi . .
2332
2333 e9/jump $parse-effective-address:end/disp32
2334 $parse-effective-address:compound-expression:
2335
2336 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2337
2338
2339
2340 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2341 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2342
2343 e8/call skip-chars-matching-whitespace-in-slice/disp32
2344
2345 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2346
2347 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2348
2349
2350
2351 56/push-esi
2352
2353 e8/call next-register/disp32
2354
2355 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2356
2357 8b/copy 0/mod/indirect 0/rm32/eax . . . 7/r32/edi . .
2358
2359
2360
2361 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2362 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2363
2364 e8/call skip-chars-matching-whitespace-in-slice/disp32
2365
2366 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2367
2368 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2369
2370 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2371 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2372 3d/compare-eax-and 0x29/imm32/close-paren
2373 0f 84/jump-if-equal $parse-effective-address:end/disp32
2374
2375 3d/compare-eax-and 0x2d/imm32/minus
2376 0f 84/jump-if-equal $parse-effective-address:displacement/disp32
2377
2378 3d/compare-eax-and 0x2b/imm32/plus
2379 0f 85/jump-if-not-equal $parse-effective-address:error1/disp32
2380 $parse-effective-address:check-for-index:
2381
2382 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2383
2384
2385
2386 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2387 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2388
2389 e8/call skip-chars-matching-whitespace-in-slice/disp32
2390
2391 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2392
2393 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2394 $parse-effective-address:resolve-ambiguity:
2395
2396
2397 51/push-ecx
2398
2399
2400 89/copy 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . .
2401
2402 05/add-to-eax 3/imm32
2403
2404 50/push-eax
2405 51/push-ecx
2406
2407 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2408
2409
2410 68/push 8/imm32/row-size
2411 51/push-ecx
2412 68/push Registers/imm32
2413
2414 e8/call maybe-get-slice/disp32
2415
2416 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2417
2418 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2419
2420 59/pop-to-ecx
2421
2422 3d/compare-eax-and 0/imm32
2423 0f 84/jump-if-equal $parse-effective-address:displacement/disp32
2424 $parse-effective-address:index:
2425
2426
2427
2428 56/push-esi
2429
2430 e8/call next-register/disp32
2431
2432 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2433
2434 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2435
2436
2437
2438 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2439 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2440
2441 e8/call skip-chars-matching-whitespace-in-slice/disp32
2442
2443 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2444
2445 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2446
2447 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2448 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2449 3d/compare-eax-and 0x29/imm32/close-paren
2450 0f 84/jump-if-equal $parse-effective-address:end/disp32
2451 $parse-effective-address:check-for-scale:
2452
2453 3d/compare-eax-and 0x3c/imm32/less-than
2454 75/jump-if-not-equal $parse-effective-address:check-for-displacement/disp8
2455
2456 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2457
2458 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2459 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2460 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2461 3d/compare-eax-and 0x3c/imm32/less-than
2462 0f 85/jump-if-not-equal $parse-effective-address:error2/disp32
2463
2464 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
2465
2466
2467
2468 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2469 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2470
2471 e8/call skip-chars-matching-whitespace-in-slice/disp32
2472
2473 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2474
2475 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2476 $parse-effective-address:scale:
2477
2478
2479
2480 56/push-esi
2481
2482 e8/call next-positive-hex-int/disp32
2483
2484 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2485
2486 89/copy 3/mod/direct 2/rm32/edx . . . 0/r32/eax . .
2487
2488
2489
2490 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2491 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2492
2493 e8/call skip-chars-matching-whitespace-in-slice/disp32
2494
2495 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2496
2497 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2498
2499 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2500 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2501 3d/compare-eax-and 0x29/imm32/close-paren
2502 74/jump-if-equal $parse-effective-address:end/disp8
2503 $parse-effective-address:check-for-displacement:
2504
2505 3d/compare-eax-and 0x2b/imm32/plus
2506 74/jump-if-equal $parse-effective-address:displacement/disp8
2507 3d/compare-eax-and 0x2d/imm32/minus
2508 74/jump-if-equal $parse-effective-address:displacement/disp8
2509 e9/jump $parse-effective-address:error3/disp32
2510 $parse-effective-address:displacement:
2511
2512
2513
2514 56/push-esi
2515
2516 e8/call next-hex-int/disp32
2517
2518 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2519
2520 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . .
2521
2522
2523
2524 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
2525 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2526
2527 e8/call skip-chars-matching-whitespace-in-slice/disp32
2528
2529 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2530
2531 89/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2532
2533 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
2534 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
2535 3d/compare-eax-and 0x29/imm32/close-paren
2536 0f 85/jump-if-not-equal $parse-effective-address:error4/disp32
2537 $parse-effective-address:end:
2538
2539 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . .
2540
2541 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2542
2543 5f/pop-to-edi
2544 5e/pop-to-esi
2545
2546 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2547 5d/pop-to-ebp
2548 c3/return
2549
2550 $parse-effective-address:error1:
2551
2552
2553
2554 68/push "error: unexpected character: "/imm32
2555 68/push Stderr/imm32
2556
2557 e8/call write-buffered/disp32
2558
2559 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2560
2561
2562 50/push-eax
2563 68/push Stderr/imm32
2564
2565 e8/call print-int32-buffered/disp32
2566
2567 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2568
2569
2570 68/push "\n"/imm32
2571 68/push Stderr/imm32
2572
2573 e8/call write-buffered/disp32
2574
2575 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2576
2577
2578 68/push Stderr/imm32
2579
2580 e8/call flush/disp32
2581
2582 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2583
2584 bb/copy-to-ebx 1/imm32
2585 b8/copy-to-eax 1/imm32/exit
2586 cd/syscall 0x80/imm8
2587
2588
2589 $parse-effective-address:error2:
2590
2591
2592
2593 68/push "error: '<' can only be followed by '<' but got: "/imm32
2594 68/push Stderr/imm32
2595
2596 e8/call write-buffered/disp32
2597
2598 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2599
2600
2601 50/push-eax
2602 68/push Stderr/imm32
2603
2604 e8/call print-int32-buffered/disp32
2605
2606 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2607
2608
2609 68/push "\n"/imm32
2610 68/push Stderr/imm32
2611
2612 e8/call write-buffered/disp32
2613
2614 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2615
2616
2617 68/push Stderr/imm32
2618
2619 e8/call flush/disp32
2620
2621 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2622
2623 bb/copy-to-ebx 1/imm32
2624 b8/copy-to-eax 1/imm32/exit
2625 cd/syscall 0x80/imm8
2626
2627
2628 $parse-effective-address:error3:
2629
2630
2631
2632 68/push "error: unexpected character before displacement: "/imm32
2633 68/push Stderr/imm32
2634
2635 e8/call write-buffered/disp32
2636
2637 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2638
2639
2640 50/push-eax
2641 68/push Stderr/imm32
2642
2643 e8/call print-int32-buffered/disp32
2644
2645 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2646
2647
2648 68/push "\n"/imm32
2649 68/push Stderr/imm32
2650
2651 e8/call write-buffered/disp32
2652
2653 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2654
2655
2656 68/push Stderr/imm32
2657
2658 e8/call flush/disp32
2659
2660 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2661
2662 bb/copy-to-ebx 1/imm32
2663 b8/copy-to-eax 1/imm32/exit
2664 cd/syscall 0x80/imm8
2665
2666
2667 $parse-effective-address:error4:
2668
2669
2670
2671 68/push "error: unexpected character after displacement: "/imm32
2672 68/push Stderr/imm32
2673
2674 e8/call write-buffered/disp32
2675
2676 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2677
2678
2679 50/push-eax
2680 68/push Stderr/imm32
2681
2682 e8/call print-int32-buffered/disp32
2683
2684 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2685
2686
2687 68/push "; expected ')' to wrap up\n"/imm32
2688 68/push Stderr/imm32
2689
2690 e8/call write-buffered/disp32
2691
2692 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2693
2694
2695 68/push Stderr/imm32
2696
2697 e8/call flush/disp32
2698
2699 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2700
2701 bb/copy-to-ebx 1/imm32
2702 b8/copy-to-eax 1/imm32/exit
2703 cd/syscall 0x80/imm8
2704
2705
2706
2707
2708 next-register:
2709
2710 55/push-ebp
2711 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2712
2713 51/push-ecx
2714 56/push-esi
2715
2716 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
2717
2718 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
2719 05/add-to-eax 3/imm32
2720 50/push-eax
2721 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
2722 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2723
2724 81 0/subop/add 0/mod/indirect 6/rm32/esi . . . . . 3/imm32
2725
2726
2727 68/push "next-register"/imm32
2728 68/push 8/imm32/row-size
2729 51/push-ecx
2730 68/push Registers/imm32
2731
2732 e8/call get-slice/disp32
2733
2734 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
2735 $next-register:end:
2736
2737 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
2738
2739 5e/pop-to-esi
2740 59/pop-to-ecx
2741
2742 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2743 5d/pop-to-ebp
2744 c3/return
2745
2746 test-parse-effective-address-simple:
2747
2748 55/push-ebp
2749 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2750
2751 b8/copy-to-eax "*esi"/imm32
2752 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2753 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2754 05/add-to-eax 4/imm32
2755
2756 51/push-ecx
2757 50/push-eax
2758 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2759
2760
2761 51/push-ecx
2762
2763 e8/call parse-effective-address/disp32
2764
2765 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2766
2767
2768
2769 68/push "F - test-parse-effective-address-simple/base"/imm32
2770 68/push 6/imm32/esi
2771 50/push-eax
2772
2773 e8/call check-ints-equal/disp32
2774
2775 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2776
2777
2778 68/push "F - test-parse-effective-address-simple/index"/imm32
2779 68/push 4/imm32/none
2780 51/push-ecx
2781
2782 e8/call check-ints-equal/disp32
2783
2784 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2785
2786
2787 68/push "F - test-parse-effective-address-simple/scale"/imm32
2788 68/push 0/imm32/none
2789 52/push-edx
2790
2791 e8/call check-ints-equal/disp32
2792
2793 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2794
2795
2796 68/push "F - test-parse-effective-address-simple/displacement"/imm32
2797 68/push 0/imm32/none
2798 53/push-ebx
2799
2800 e8/call check-ints-equal/disp32
2801
2802 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2803
2804 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2805 5d/pop-to-ebp
2806 c3/return
2807
2808 test-parse-effective-address-base:
2809
2810 55/push-ebp
2811 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2812
2813 b8/copy-to-eax "*(esi )"/imm32
2814 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2815 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2816 05/add-to-eax 4/imm32
2817
2818 51/push-ecx
2819 50/push-eax
2820 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2821
2822
2823 51/push-ecx
2824
2825 e8/call parse-effective-address/disp32
2826
2827 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2828
2829
2830
2831 68/push "F - test-parse-effective-address-base/base"/imm32
2832 68/push 6/imm32/esi
2833 50/push-eax
2834
2835 e8/call check-ints-equal/disp32
2836
2837 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2838
2839
2840 68/push "F - test-parse-effective-address-base/index"/imm32
2841 68/push 4/imm32/none
2842 51/push-ecx
2843
2844 e8/call check-ints-equal/disp32
2845
2846 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2847
2848
2849 68/push "F - test-parse-effective-address-base/scale"/imm32
2850 68/push 0/imm32/none
2851 52/push-edx
2852
2853 e8/call check-ints-equal/disp32
2854
2855 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2856
2857
2858 68/push "F - test-parse-effective-address-base/displacement"/imm32
2859 68/push 0/imm32/none
2860 53/push-ebx
2861
2862 e8/call check-ints-equal/disp32
2863
2864 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2865
2866 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2867 5d/pop-to-ebp
2868 c3/return
2869
2870 test-parse-effective-address-base-displacement:
2871
2872 55/push-ebp
2873 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2874
2875 b8/copy-to-eax "*(esi+3)"/imm32
2876 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2877 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2878 05/add-to-eax 4/imm32
2879
2880 51/push-ecx
2881 50/push-eax
2882 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2883
2884
2885 51/push-ecx
2886
2887 e8/call parse-effective-address/disp32
2888
2889 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2890
2891
2892
2893 68/push "F - test-parse-effective-address-base-displacement/base"/imm32
2894 68/push 6/imm32/esi
2895 50/push-eax
2896
2897 e8/call check-ints-equal/disp32
2898
2899 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2900
2901
2902 68/push "F - test-parse-effective-address-base-displacement/index"/imm32
2903 68/push 4/imm32/none
2904 51/push-ecx
2905
2906 e8/call check-ints-equal/disp32
2907
2908 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2909
2910
2911 68/push "F - test-parse-effective-address-base-displacement/scale"/imm32
2912 68/push 0/imm32/none
2913 52/push-edx
2914
2915 e8/call check-ints-equal/disp32
2916
2917 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2918
2919
2920 68/push "F - test-parse-effective-address-base-displacement/displacement"/imm32
2921 68/push 3/imm32
2922 53/push-ebx
2923
2924 e8/call check-ints-equal/disp32
2925
2926 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2927
2928 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2929 5d/pop-to-ebp
2930 c3/return
2931
2932 test-parse-effective-address-base-negative-displacement:
2933
2934 55/push-ebp
2935 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2936
2937 b8/copy-to-eax "*(esi-3)"/imm32
2938 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
2939 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
2940 05/add-to-eax 4/imm32
2941
2942 51/push-ecx
2943 50/push-eax
2944 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
2945
2946
2947 51/push-ecx
2948
2949 e8/call parse-effective-address/disp32
2950
2951 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
2952
2953
2954
2955 68/push "F - test-parse-effective-address-base-negative-displacement/base"/imm32
2956 68/push 6/imm32/esi
2957 50/push-eax
2958
2959 e8/call check-ints-equal/disp32
2960
2961 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2962
2963
2964 68/push "F - test-parse-effective-address-base-negative-displacement/index"/imm32
2965 68/push 4/imm32/none
2966 51/push-ecx
2967
2968 e8/call check-ints-equal/disp32
2969
2970 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2971
2972
2973 68/push "F - test-parse-effective-address-base-negative-displacement/scale"/imm32
2974 68/push 0/imm32/none
2975 52/push-edx
2976
2977 e8/call check-ints-equal/disp32
2978
2979 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2980
2981
2982 68/push "F - test-parse-effective-address-base-negative-displacement/displacement"/imm32
2983 68/push -3/imm32
2984 53/push-ebx
2985
2986 e8/call check-ints-equal/disp32
2987
2988 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
2989
2990 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
2991 5d/pop-to-ebp
2992 c3/return
2993
2994 test-parse-effective-address-base-index:
2995
2996 55/push-ebp
2997 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
2998
2999 b8/copy-to-eax "*(esi+ecx)"/imm32
3000 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
3001 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
3002 05/add-to-eax 4/imm32
3003
3004 51/push-ecx
3005 50/push-eax
3006 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3007
3008
3009 51/push-ecx
3010
3011 e8/call parse-effective-address/disp32
3012
3013 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3014
3015
3016
3017 68/push "F - test-parse-effective-address-base-index/base"/imm32
3018 68/push 6/imm32/esi
3019 50/push-eax
3020
3021 e8/call check-ints-equal/disp32
3022
3023 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3024
3025
3026 68/push "F - test-parse-effective-address-base-index/index"/imm32
3027 68/push 1/imm32/none
3028 51/push-ecx
3029
3030 e8/call check-ints-equal/disp32
3031
3032 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3033
3034
3035 68/push "F - test-parse-effective-address-base-index/scale"/imm32
3036 68/push 0/imm32/none
3037 52/push-edx
3038
3039 e8/call check-ints-equal/disp32
3040
3041 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3042
3043
3044 68/push "F - test-parse-effective-address-base-index/displacement"/imm32
3045 68/push 0/imm32
3046 53/push-ebx
3047
3048 e8/call check-ints-equal/disp32
3049
3050 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3051
3052 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3053 5d/pop-to-ebp
3054 c3/return
3055
3056 test-parse-effective-address-base-index-scale:
3057
3058 55/push-ebp
3059 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3060
3061 b8/copy-to-eax "*(esi+ecx<<2)"/imm32
3062 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
3063 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
3064 05/add-to-eax 4/imm32
3065
3066 51/push-ecx
3067 50/push-eax
3068 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3069
3070
3071 51/push-ecx
3072
3073 e8/call parse-effective-address/disp32
3074
3075 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3076
3077
3078
3079 68/push "F - test-parse-effective-address-base-index-scale/base"/imm32
3080 68/push 6/imm32/esi
3081 50/push-eax
3082
3083 e8/call check-ints-equal/disp32
3084
3085 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3086
3087
3088 68/push "F - test-parse-effective-address-base-index-scale/index"/imm32
3089 68/push 1/imm32/none
3090 51/push-ecx
3091
3092 e8/call check-ints-equal/disp32
3093
3094 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3095
3096
3097 68/push "F - test-parse-effective-address-base-index-scale/scale"/imm32
3098 68/push 2/imm32
3099 52/push-edx
3100
3101 e8/call check-ints-equal/disp32
3102
3103 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3104
3105
3106 68/push "F - test-parse-effective-address-base-index-scale/displacement"/imm32
3107 68/push 0/imm32
3108 53/push-ebx
3109
3110 e8/call check-ints-equal/disp32
3111
3112 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3113
3114 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3115 5d/pop-to-ebp
3116 c3/return
3117
3118 test-parse-effective-address-base-index-scale-displacement:
3119
3120 55/push-ebp
3121 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3122
3123 b8/copy-to-eax "*(esi + ecx<<2 - 0x34)"/imm32
3124 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
3125 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
3126 05/add-to-eax 4/imm32
3127
3128 51/push-ecx
3129 50/push-eax
3130 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
3131
3132
3133 51/push-ecx
3134
3135 e8/call parse-effective-address/disp32
3136
3137 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3138
3139
3140
3141 68/push "F - test-parse-effective-address-base-index-scale/base"/imm32
3142 68/push 6/imm32/esi
3143 50/push-eax
3144
3145 e8/call check-ints-equal/disp32
3146
3147 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3148
3149
3150 68/push "F - test-parse-effective-address-base-index-scale/index"/imm32
3151 68/push 1/imm32/none
3152 51/push-ecx
3153
3154 e8/call check-ints-equal/disp32
3155
3156 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3157
3158
3159 68/push "F - test-parse-effective-address-base-index-scale/scale"/imm32
3160 68/push 2/imm32
3161 52/push-edx
3162
3163 e8/call check-ints-equal/disp32
3164
3165 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3166
3167
3168 68/push "F - test-parse-effective-address-base-index-scale/displacement"/imm32
3169 68/push -0x34/imm32
3170 53/push-ebx
3171
3172 e8/call check-ints-equal/disp32
3173
3174 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3175
3176 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3177 5d/pop-to-ebp
3178 c3/return
3179
3180
3181
3182
3183
3184
3185
3186
3187 emit-indirect-mode:
3188
3189 55/push-ebp
3190 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3191 $emit-indirect-mode:check-for-ebp:
3192
3193 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 5/imm32
3194 74/jump-if-equal $emit-indirect-mode:emit-sib/disp8
3195 $emit-indirect-mode:check-for-esp:
3196
3197 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 4/imm32
3198 74/jump-if-equal $emit-indirect-mode:emit-sib/disp8
3199 $emit-indirect-mode:check-for-sib:
3200
3201 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 4/imm32
3202 0f 84/jump-if-equal $emit-indirect-mode:check-for-disp/disp32
3203 $emit-indirect-mode:emit-sib:
3204
3205
3206
3207 68/push "2/mod/*+disp32 4/rm32/sib "/imm32
3208 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3209
3210 e8/call write-buffered/disp32
3211
3212 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3213
3214
3215 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3216 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3217
3218 e8/call print-int32-buffered/disp32
3219
3220 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3221
3222
3223 68/push "/base "/imm32
3224 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3225
3226 e8/call write-buffered/disp32
3227
3228 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3229
3230
3231 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 .
3232 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3233
3234 e8/call print-int32-buffered/disp32
3235
3236 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3237
3238
3239 68/push "/index "/imm32
3240 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3241
3242 e8/call write-buffered/disp32
3243
3244 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3245
3246
3247 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 .
3248 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3249
3250 e8/call print-int32-buffered/disp32
3251
3252 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3253
3254
3255 68/push "/scale "/imm32
3256 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3257
3258 e8/call write-buffered/disp32
3259
3260 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3261
3262
3263 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 .
3264 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3265
3266 e8/call print-int32-buffered/disp32
3267
3268 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3269
3270
3271 68/push "/disp32"/imm32
3272 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3273
3274 e8/call write-buffered/disp32
3275
3276 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3277 e9/jump $emit-indirect-mode:end/disp32
3278 $emit-indirect-mode:check-for-disp:
3279
3280 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 0/imm32
3281 74/jump-if-equal $emit-indirect-mode:emit-indirect/disp8
3282 $emit-indirect-mode:emit-disp:
3283
3284
3285
3286 68/push "2/mod/*+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
3293
3294 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3295 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3296
3297 e8/call print-int32-buffered/disp32
3298
3299 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3300
3301
3302 68/push "/rm32 "/imm32
3303 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3304
3305 e8/call write-buffered/disp32
3306
3307 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3308
3309
3310 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 .
3311 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3312
3313 e8/call print-int32-buffered/disp32
3314
3315 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3316
3317
3318 68/push "/disp32"/imm32
3319 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3320
3321 e8/call write-buffered/disp32
3322
3323 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3324 eb/jump $emit-indirect-mode:end/disp8
3325 $emit-indirect-mode:emit-indirect:
3326
3327
3328
3329 68/push "0/mod/indirect "/imm32
3330 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3331
3332 e8/call write-buffered/disp32
3333
3334 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3335
3336
3337 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 .
3338 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3339
3340 e8/call print-int32-buffered/disp32
3341
3342 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3343
3344
3345 68/push "/rm32"/imm32
3346 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3347
3348 e8/call write-buffered/disp32
3349
3350 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3351 $emit-indirect-mode:end:
3352
3353 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3354 5d/pop-to-ebp
3355 c3/return
3356
3357 test-emit-indirect-mode:
3358
3359 55/push-ebp
3360 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3361
3362
3363
3364 68/push _test-output-stream/imm32
3365
3366 e8/call clear-stream/disp32
3367
3368 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3369
3370
3371 b8/copy-to-eax _test-output-buffered-file/imm32
3372 05/add-to-eax 4/imm32
3373 50/push-eax
3374
3375 e8/call clear-stream/disp32
3376
3377 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3378
3379
3380 68/push 0/imm32/.disp
3381 68/push 0/imm32/.scale
3382 68/push 4/imm32/.index/none
3383 68/push 0/imm32/.base
3384 68/push _test-output-buffered-file/imm32
3385
3386 e8/call emit-indirect-mode/disp32
3387
3388 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3389
3390
3391 68/push _test-output-buffered-file/imm32
3392
3393 e8/call flush/disp32
3394
3395 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3396 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3422
3423
3424 68/push "F - test-emit-indirect-mode"/imm32
3425 68/push "0/mod/indirect 0x00000000/rm32"/imm32
3426 68/push _test-output-stream/imm32
3427
3428 e8/call check-stream-equal/disp32
3429
3430 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3431
3432 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3433 5d/pop-to-ebp
3434 c3/return
3435
3436 test-emit-indirect-mode-2:
3437
3438 55/push-ebp
3439 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3440
3441
3442
3443 68/push _test-output-stream/imm32
3444
3445 e8/call clear-stream/disp32
3446
3447 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3448
3449
3450 b8/copy-to-eax _test-output-buffered-file/imm32
3451 05/add-to-eax 4/imm32
3452 50/push-eax
3453
3454 e8/call clear-stream/disp32
3455
3456 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3457
3458
3459 68/push 0/imm32/.disp
3460 68/push 0/imm32/.scale
3461 68/push 4/imm32/.index/none
3462 68/push 7/imm32/.base
3463 68/push _test-output-buffered-file/imm32
3464
3465 e8/call emit-indirect-mode/disp32
3466
3467 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3468
3469
3470 68/push _test-output-buffered-file/imm32
3471
3472 e8/call flush/disp32
3473
3474 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3475 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3501
3502
3503 68/push "F - test-emit-indirect-mode-2"/imm32
3504 68/push "0/mod/indirect 0x00000007/rm32"/imm32
3505 68/push _test-output-stream/imm32
3506
3507 e8/call check-stream-equal/disp32
3508
3509 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3510
3511 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3512 5d/pop-to-ebp
3513 c3/return
3514
3515 test-emit-indirect-mode-with-disp:
3516
3517 55/push-ebp
3518 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3519
3520
3521
3522 68/push _test-output-stream/imm32
3523
3524 e8/call clear-stream/disp32
3525
3526 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3527
3528
3529 b8/copy-to-eax _test-output-buffered-file/imm32
3530 05/add-to-eax 4/imm32
3531 50/push-eax
3532
3533 e8/call clear-stream/disp32
3534
3535 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3536
3537
3538 68/push 4/imm32/.disp
3539 68/push 0/imm32/.scale
3540 68/push 4/imm32/.index/none
3541 68/push 6/imm32/.base
3542 68/push _test-output-buffered-file/imm32
3543
3544 e8/call emit-indirect-mode/disp32
3545
3546 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3547
3548
3549 68/push _test-output-buffered-file/imm32
3550
3551 e8/call flush/disp32
3552
3553 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3554 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3580
3581
3582 68/push "F - test-emit-indirect-mode-with-disp"/imm32
3583 68/push "2/mod/*+disp32 0x00000006/rm32 0x00000004/disp32"/imm32
3584 68/push _test-output-stream/imm32
3585
3586 e8/call check-stream-equal/disp32
3587
3588 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3589
3590 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3591 5d/pop-to-ebp
3592 c3/return
3593
3594 test-emit-indirect-mode-with-disp-negative:
3595
3596 55/push-ebp
3597 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3598
3599
3600
3601 68/push _test-output-stream/imm32
3602
3603 e8/call clear-stream/disp32
3604
3605 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3606
3607
3608 b8/copy-to-eax _test-output-buffered-file/imm32
3609 05/add-to-eax 4/imm32
3610 50/push-eax
3611
3612 e8/call clear-stream/disp32
3613
3614 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3615
3616
3617 68/push -4/imm32/.disp
3618 68/push 0/imm32/.scale
3619 68/push 4/imm32/.index/none
3620 68/push 6/imm32/.base
3621 68/push _test-output-buffered-file/imm32
3622
3623 e8/call emit-indirect-mode/disp32
3624
3625 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3626
3627
3628 68/push _test-output-buffered-file/imm32
3629
3630 e8/call flush/disp32
3631
3632 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3633 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3659
3660
3661 68/push "F - test-emit-indirect-mode-with-disp"/imm32
3662 68/push "2/mod/*+disp32 0x00000006/rm32 0xfffffffc/disp32"/imm32
3663 68/push _test-output-stream/imm32
3664
3665 e8/call check-stream-equal/disp32
3666
3667 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3668
3669 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3670 5d/pop-to-ebp
3671 c3/return
3672
3673 test-emit-indirect-mode-with-sib:
3674
3675 55/push-ebp
3676 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3677
3678
3679
3680 68/push _test-output-stream/imm32
3681
3682 e8/call clear-stream/disp32
3683
3684 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3685
3686
3687 b8/copy-to-eax _test-output-buffered-file/imm32
3688 05/add-to-eax 4/imm32
3689 50/push-eax
3690
3691 e8/call clear-stream/disp32
3692
3693 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3694
3695
3696 68/push 4/imm32/.disp
3697 68/push 2/imm32/.scale
3698 68/push 1/imm32/.index
3699 68/push 6/imm32/.base
3700 68/push _test-output-buffered-file/imm32
3701
3702 e8/call emit-indirect-mode/disp32
3703
3704 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3705
3706
3707 68/push _test-output-buffered-file/imm32
3708
3709 e8/call flush/disp32
3710
3711 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3712 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3738
3739
3740 68/push "F - test-emit-indirect-mode-with-sib"/imm32
3741 68/push "2/mod/*+disp32 4/rm32/sib 0x00000006/base 0x00000001/index 0x00000002/scale 0x00000004/disp32"/imm32
3742 68/push _test-output-stream/imm32
3743
3744 e8/call check-stream-equal/disp32
3745
3746 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3747
3748 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3749 5d/pop-to-ebp
3750 c3/return
3751
3752 test-emit-indirect-mode-ebp:
3753
3754 55/push-ebp
3755 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3756
3757
3758
3759 68/push _test-output-stream/imm32
3760
3761 e8/call clear-stream/disp32
3762
3763 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3764
3765
3766 b8/copy-to-eax _test-output-buffered-file/imm32
3767 05/add-to-eax 4/imm32
3768 50/push-eax
3769
3770 e8/call clear-stream/disp32
3771
3772 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3773
3774
3775 68/push 0/imm32/.disp
3776 68/push 0/imm32/.scale
3777 68/push 0/imm32/.index
3778 68/push 5/imm32/.base/ebp
3779 68/push _test-output-buffered-file/imm32
3780
3781 e8/call emit-indirect-mode/disp32
3782
3783 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3784
3785
3786 68/push _test-output-buffered-file/imm32
3787
3788 e8/call flush/disp32
3789
3790 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3791 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3817
3818
3819 68/push "F - test-emit-indirect-mode-ebp"/imm32
3820 68/push "2/mod/*+disp32 4/rm32/sib 0x00000005/base 0x00000000/index 0x00000000/scale 0x00000000/disp32"/imm32
3821 68/push _test-output-stream/imm32
3822
3823 e8/call check-stream-equal/disp32
3824
3825 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3826
3827 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3828 5d/pop-to-ebp
3829 c3/return
3830
3831 test-emit-indirect-mode-esp:
3832
3833 55/push-ebp
3834 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3835
3836
3837
3838 68/push _test-output-stream/imm32
3839
3840 e8/call clear-stream/disp32
3841
3842 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3843
3844
3845 b8/copy-to-eax _test-output-buffered-file/imm32
3846 05/add-to-eax 4/imm32
3847 50/push-eax
3848
3849 e8/call clear-stream/disp32
3850
3851 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3852
3853
3854 68/push 0/imm32/.disp
3855 68/push 0/imm32/.scale
3856 68/push 0/imm32/.index
3857 68/push 4/imm32/.base/esp
3858 68/push _test-output-buffered-file/imm32
3859
3860 e8/call emit-indirect-mode/disp32
3861
3862 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32
3863
3864
3865 68/push _test-output-buffered-file/imm32
3866
3867 e8/call flush/disp32
3868
3869 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
3870 +-- 26 lines: #? # dump output ---------------------------------------------------------------------------------------------------------------------------
3896
3897
3898 68/push "F - test-emit-indirect-mode-esp"/imm32
3899 68/push "2/mod/*+disp32 4/rm32/sib 0x00000004/base 0x00000000/index 0x00000000/scale 0x00000000/disp32"/imm32
3900 68/push _test-output-stream/imm32
3901
3902 e8/call check-stream-equal/disp32
3903
3904 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3905
3906 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3907 5d/pop-to-ebp
3908 c3/return
3909
3910 disp32-mode?:
3911
3912 55/push-ebp
3913 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3914
3915 56/push-esi
3916 57/push-edi
3917
3918 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
3919 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
3920 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
3921 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
3922
3923 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
3924
3925 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . .
3926 8a/copy-byte 0/mod/indirect 0/rm32/eax . . . 0/r32/AL . .
3927 81 4/subop/and 3/mod/direct 0/rm32/eax . . . . . 0xff/imm32
3928 3d/compare-eax-and 0x28/imm32/open-paren
3929 74/jump-if-equal $disp32-mode?:false/disp8
3930 $disp32-mode?:check-for-register:
3931
3932
3933 56/push-esi
3934 68/push 0x2f/imm32/slash
3935 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
3936 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
3937
3938 e8/call next-token-from-slice/disp32
3939
3940 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32
3941
3942
3943 68/push 8/imm32/row-size
3944 56/push-esi
3945 68/push Registers/imm32
3946
3947 e8/call maybe-get-slice/disp32
3948
3949 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
3950
3951 3d/compare-eax-and 0/imm32
3952 75/jump-if-not-equal $disp32-mode?:false/disp8
3953
3954 b8/copy-to-eax 1/imm32/true
3955 eb/jump $disp32-mode?:end/disp8
3956 $disp32-mode?:false:
3957 b8/copy-to-eax 0/imm32/false
3958 $disp32-mode?:end:
3959
3960 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3961
3962 5f/pop-to-edi
3963 5e/pop-to-esi
3964
3965 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
3966 5d/pop-to-ebp
3967 c3/return
3968
3969 emit-indirect-disp32:
3970
3971 55/push-ebp
3972 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
3973
3974 56/push-esi
3975
3976 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 0xc/disp8 .
3977 ff 6/subop/push 1/mod/*+disp8 6/rm32/esi . . . . 4/disp8 .
3978 ff 6/subop/push 0/mod/indirect 6/rm32/esi . . . . . .
3979 89/copy 3/mod/direct 6/rm32/esi . . . 4/r32/esp . .
3980
3981 ff 0/subop/increment 0/mod/indirect 6/rm32/esi . . . . . .
3982
3983
3984 68/push "0/mod/indirect 5/rm32/.disp32 "/imm32
3985 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3986
3987 e8/call write-buffered/disp32
3988
3989 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3990
3991
3992 56/push-esi
3993 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
3994
3995 e8/call write-slice-buffered/disp32
3996
3997 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
3998
3999
4000 68/push "/disp32"/imm32
4001 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
4002
4003 e8/call write-buffered/disp32
4004
4005 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4006 $emit-indirect-disp32:end:
4007
4008 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4009
4010 5e/pop-to-esi
4011
4012 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4013 5d/pop-to-ebp
4014 c3/return
4015
4016
4017
4018 skip-until-close-paren:
4019
4020 55/push-ebp
4021 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4022
4023 50/push-eax
4024 51/push-ecx
4025 52/push-edx
4026
4027 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 8/disp8 .
4028
4029
4030 8b/copy 1/mod/*+disp8 1/rm32/ecx . . 2/r32/edx 8/disp8 .
4031 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx 0xc/disp8 .
4032 52/push-edx
4033
4034 8b/copy 1/mod/*+disp8 1/rm32/ecx . . 2/r32/edx 4/disp8 .
4035 8d/copy-address 1/mod/*+disp8 4/rm32/sib 1/base/ecx 2/index/edx . 2/r32/edx 0xc/disp8 .
4036 52/push-edx
4037
4038 e8/call skip-until-close-paren-in-slice/disp32
4039
4040 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4041
4042 29/subtract 3/mod/direct 0/rm32/eax . . . 1/r32/ecx . .
4043 2d/subtract-from-eax 0xc/imm32
4044 89/copy 1/mod/*+disp8 1/rm32/ecx . . 0/r32/eax 4/disp8 .
4045 $skip-until-close-paren:end:
4046
4047 5a/pop-to-edx
4048 59/pop-to-ecx
4049 58/pop-to-eax
4050
4051 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4052 5d/pop-to-ebp
4053 c3/return
4054
4055 test-skip-until-close-paren:
4056
4057 55/push-ebp
4058 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4059
4060
4061
4062 68/push _test-input-stream/imm32
4063
4064 e8/call clear-stream/disp32
4065
4066 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4067
4068
4069
4070 68/push "*(abc) def"/imm32
4071 68/push _test-input-stream/imm32
4072
4073 e8/call write/disp32
4074
4075 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4076
4077
4078 68/push "F - test-skip-until-close-paren/precondition"/imm32
4079 68/push 0/imm32
4080 b8/copy-to-eax _test-input-stream/imm32
4081 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
4082
4083 e8/call check-ints-equal/disp32
4084
4085 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4086
4087
4088 68/push _test-input-stream/imm32
4089
4090 e8/call skip-until-close-paren/disp32
4091
4092 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4093
4094
4095 68/push "F - test-skip-until-close-paren"/imm32
4096 68/push 5/imm32
4097 b8/copy-to-eax _test-input-stream/imm32
4098 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
4099
4100 e8/call check-ints-equal/disp32
4101
4102 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4103
4104 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4105 5d/pop-to-ebp
4106 c3/return
4107
4108 test-skip-until-close-paren-ignores-spaces:
4109
4110 55/push-ebp
4111 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4112
4113
4114
4115 68/push _test-input-stream/imm32
4116
4117 e8/call clear-stream/disp32
4118
4119 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4120
4121
4122 68/push "*(a b)/yz"/imm32
4123 68/push _test-input-stream/imm32
4124
4125 e8/call write/disp32
4126
4127 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4128
4129
4130 68/push "F - test-skip-until-close-paren-ignores-spaces/precondition"/imm32
4131 68/push 0/imm32
4132 b8/copy-to-eax _test-input-stream/imm32
4133 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
4134
4135 e8/call check-ints-equal/disp32
4136
4137 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4138
4139
4140 68/push _test-input-stream/imm32
4141
4142 e8/call skip-until-close-paren/disp32
4143
4144 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4145
4146
4147 68/push "F - test-skip-until-close-paren-ignores-spaces"/imm32
4148 68/push 5/imm32
4149 b8/copy-to-eax _test-input-stream/imm32
4150 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
4151
4152 e8/call check-ints-equal/disp32
4153
4154 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4155
4156 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4157 5d/pop-to-ebp
4158 c3/return
4159
4160 test-skip-until-close-paren-works-from-mid-stream:
4161
4162 55/push-ebp
4163 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4164
4165
4166
4167 68/push _test-input-stream/imm32
4168
4169 e8/call clear-stream/disp32
4170
4171 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4172
4173
4174 68/push "0 *(a b)/yz"/imm32
4175 68/push _test-input-stream/imm32
4176
4177 e8/call write/disp32
4178
4179 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4180
4181 c7 0/subop/copy 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 2/imm32
4182
4183
4184 68/push _test-input-stream/imm32
4185
4186 e8/call skip-until-close-paren/disp32
4187
4188 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4189
4190
4191 68/push "F - test-skip-until-close-paren-works-from-mid-stream"/imm32
4192 68/push 7/imm32
4193 b8/copy-to-eax _test-input-stream/imm32
4194 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
4195
4196 e8/call check-ints-equal/disp32
4197
4198 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4199
4200 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4201 5d/pop-to-ebp
4202 c3/return
4203
4204 skip-until-close-paren-in-slice:
4205
4206 55/push-ebp
4207 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4208
4209 51/push-ecx
4210 52/push-edx
4211
4212 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 8/disp8 .
4213
4214 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 2/r32/edx 0xc/disp8 .
4215
4216 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4217
4218 41/increment-ecx
4219 $skip-until-close-paren-in-slice:loop:
4220
4221 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4222 73/jump-if-greater-unsigned-or-equal $skip-until-close-paren-in-slice:break/disp8
4223
4224 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4225 $skip-until-close-paren-in-slice:check-close:
4226
4227 3d/compare-eax-and 0x29/imm32/close-paren
4228 74/jump-if-equal $skip-until-close-paren-in-slice:break/disp8
4229
4230 41/increment-ecx
4231 eb/jump $skip-until-close-paren-in-slice:loop/disp8
4232 $skip-until-close-paren-in-slice:break:
4233
4234 89/copy 3/mod/direct 0/rm32/eax . . . 1/r32/ecx . .
4235 $skip-until-close-paren-in-slice:end:
4236
4237 5a/pop-to-edx
4238 59/pop-to-ecx
4239
4240 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4241 5d/pop-to-ebp
4242 c3/return
4243
4244 test-skip-until-close-paren-in-slice:
4245
4246 55/push-ebp
4247 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4248
4249 b8/copy-to-eax "*(abc) def"/imm32
4250 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4251 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4252 05/add-to-eax 4/imm32
4253
4254
4255 51/push-ecx
4256 50/push-eax
4257
4258 e8/call skip-until-close-paren-in-slice/disp32
4259
4260 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4261
4262
4263 68/push "F - test-skip-until-close-paren-in-slice"/imm32
4264 68/push 5/imm32
4265
4266 29/subtract 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . .
4267 51/push-ecx
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-skip-until-close-paren-in-slice-ignores-spaces:
4278
4279 55/push-ebp
4280 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4281
4282 b8/copy-to-eax "*(a b)/yz"/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
4288 51/push-ecx
4289 50/push-eax
4290
4291 e8/call skip-until-close-paren-in-slice/disp32
4292
4293 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4294
4295
4296 68/push "F - test-skip-until-close-paren-in-slice-ignores-spaces"/imm32
4297 68/push 4/imm32
4298
4299 29/subtract 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . .
4300 51/push-ecx
4301
4302 e8/call check-ints-equal/disp32
4303
4304 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4305
4306 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4307 5d/pop-to-ebp
4308 c3/return
4309
4310 test-skip-until-close-paren-in-slice-stops-at-end:
4311
4312 55/push-ebp
4313 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4314
4315 b8/copy-to-eax "*(abc"/imm32
4316 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4317 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4318 05/add-to-eax 4/imm32
4319
4320
4321 51/push-ecx
4322 50/push-eax
4323
4324 e8/call skip-until-close-paren-in-slice/disp32
4325
4326 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4327
4328
4329 68/push "F - test-skip-until-close-paren-in-slice-stops-at-end"/imm32
4330 68/push 0/imm32
4331
4332 29/subtract 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . .
4333 51/push-ecx
4334
4335 e8/call check-ints-equal/disp32
4336
4337 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4338
4339 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4340 5d/pop-to-ebp
4341 c3/return
4342
4343
4344
4345
4346 next-hex-int:
4347
4348 55/push-ebp
4349 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4350
4351 51/push-ecx
4352 52/push-edx
4353 53/push-ebx
4354 56/push-esi
4355 57/push-edi
4356
4357 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
4358
4359 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
4360
4361 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 4/disp8 .
4362
4363 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
4364
4365 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
4366
4367 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4368 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4369 $next-hex-int:positive:
4370
4371 3d/compare-eax-and 0x2b/imm32/+
4372 75/jump-if-not-equal $next-hex-int:negative/disp8
4373
4374 41/increment-ecx
4375 eb/jump $next-hex-int:skip-whitespace/disp8
4376 $next-hex-int:negative:
4377
4378 3d/compare-eax-and 0x2d/imm32/-
4379 75/jump-if-not-equal $next-hex-int:skip-whitespace/disp8
4380 $next-hex-int:need-to-negate:
4381
4382 41/increment-ecx
4383
4384 bb/copy-to-ebx 1/imm32/true
4385
4386 $next-hex-int:skip-whitespace:
4387
4388 50/push-eax
4389
4390
4391 52/push-edx
4392 51/push-ecx
4393
4394 e8/call skip-chars-matching-whitespace-in-slice/disp32
4395
4396 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4397
4398 89/copy 3/mod/direct 1/rm32/ecx . . . 0/r32/eax . .
4399
4400 58/pop-to-eax
4401 $next-hex-int:initial-0:
4402
4403
4404 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4405 3d/compare-eax-and 0x30/imm32/0
4406 75/jump-if-not-equal $next-hex-int:loop/disp8
4407
4408 41/increment-ecx
4409 $next-hex-int:initial-0x:
4410
4411 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4412 73/jump-if-greater-or-equal-unsigned $next-hex-int:end/disp8
4413
4414 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4415 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4416 3d/compare-eax-and 0x78/imm32/x
4417 75/jump-if-not-equal $next-hex-int:loop/disp8
4418
4419 41/increment-ecx
4420 $next-hex-int:loop:
4421
4422 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4423 73/jump-if-greater-or-equal-unsigned $next-hex-int:break/disp8
4424
4425
4426 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4427
4428
4429 50/push-eax
4430
4431 e8/call is-hex-digit?/disp32
4432
4433 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4434
4435 3d/compare-eax-and 0/imm32
4436 74/jump-if-equal $next-hex-int:break/disp8
4437
4438
4439 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4440
4441 e8/call from-hex-char/disp32
4442
4443 c1/shift 4/subop/left 3/mod/direct 7/rm32/edi . . . . . 4/imm8
4444 01/add 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
4445
4446 41/increment-ecx
4447
4448 eb/jump $next-hex-int:loop/disp8
4449 $next-hex-int:break:
4450 81 7/subop/compare 3/mod/direct 3/rm32/ebx . . . . . 0/imm32
4451 74/jump-if-equal $next-hex-int:end/disp8
4452 $next-hex-int:negate:
4453 f7 3/subop/negate 3/mod/direct 7/rm32/edi . . . . . .
4454 $next-hex-int:end:
4455
4456 89/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
4457
4458 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . .
4459
4460 5f/pop-to-edi
4461 5e/pop-to-esi
4462 5b/pop-to-ebx
4463 5a/pop-to-edx
4464 59/pop-to-ecx
4465
4466 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4467 5d/pop-to-ebp
4468 c3/return
4469
4470 $next-hex-int:abort:
4471
4472
4473 68/push "next-hex-int: invalid hex char: "/imm32
4474 68/push 2/imm32/stderr
4475
4476 e8/call _write/disp32
4477
4478 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4479
4480
4481 50/push-eax
4482
4483 b8/copy-to-eax Stderr/imm32
4484 05/add-to-eax 4/imm32
4485 50/push-eax
4486
4487 e8/call clear-stream/disp32
4488
4489 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4490
4491 58/pop-to-eax
4492
4493
4494 50/push-eax
4495 68/push Stderr/imm32
4496
4497 e8/call print-int32-buffered/disp32
4498
4499 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4500
4501
4502 68/push Stderr/imm32
4503
4504 e8/call flush/disp32
4505
4506 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4507
4508
4509 68/push "\n"/imm32
4510 68/push 2/imm32/stderr
4511
4512 e8/call _write/disp32
4513
4514 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
4515
4516 bb/copy-to-ebx 1/imm32
4517 b8/copy-to-eax 1/imm32/exit
4518 cd/syscall 0x80/imm8
4519
4520
4521 test-next-hex-int-single-digit:
4522
4523 55/push-ebp
4524 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4525
4526 b8/copy-to-eax "+a)"/imm32
4527 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4528 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4529 05/add-to-eax 4/imm32
4530
4531 51/push-ecx
4532 50/push-eax
4533 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4534
4535
4536 51/push-ecx
4537
4538 e8/call next-hex-int/disp32
4539
4540 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4541
4542
4543 68/push "F - test-next-hex-int-single-digit"/imm32
4544 68/push 0xa/imm32
4545 50/push-eax
4546
4547 e8/call check-ints-equal/disp32
4548
4549 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4550
4551 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4552 5d/pop-to-ebp
4553 c3/return
4554
4555 test-next-hex-int-multi-digit:
4556
4557 55/push-ebp
4558 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4559
4560 b8/copy-to-eax "+ 34a)"/imm32
4561 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4562 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4563 05/add-to-eax 4/imm32
4564
4565 51/push-ecx
4566 50/push-eax
4567 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4568
4569
4570 51/push-ecx
4571
4572 e8/call next-hex-int/disp32
4573
4574 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4575
4576
4577 68/push "F - test-next-hex-int-multi-digit"/imm32
4578 68/push 0x34a/imm32
4579 50/push-eax
4580
4581 e8/call check-ints-equal/disp32
4582
4583 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4584
4585 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4586 5d/pop-to-ebp
4587 c3/return
4588
4589 test-next-hex-int-0x-prefix:
4590
4591 55/push-ebp
4592 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4593
4594 b8/copy-to-eax "+0x34)"/imm32
4595 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4596 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4597 05/add-to-eax 4/imm32
4598
4599 51/push-ecx
4600 50/push-eax
4601 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4602
4603
4604 51/push-ecx
4605
4606 e8/call next-hex-int/disp32
4607
4608 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4609
4610
4611 68/push "F - test-next-hex-int-0x-prefix"/imm32
4612 68/push 0x34/imm32
4613 50/push-eax
4614
4615 e8/call check-ints-equal/disp32
4616
4617 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4618
4619 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4620 5d/pop-to-ebp
4621 c3/return
4622
4623 test-next-hex-int-zero:
4624
4625 55/push-ebp
4626 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4627
4628 b8/copy-to-eax "+0)"/imm32
4629 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4630 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4631 05/add-to-eax 4/imm32
4632
4633 51/push-ecx
4634 50/push-eax
4635 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4636
4637
4638 51/push-ecx
4639
4640 e8/call next-hex-int/disp32
4641
4642 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4643
4644
4645 68/push "F - test-next-hex-int-zero"/imm32
4646 68/push 0/imm32
4647 50/push-eax
4648
4649 e8/call check-ints-equal/disp32
4650
4651 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4652
4653 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4654 5d/pop-to-ebp
4655 c3/return
4656
4657 test-next-hex-int-0-prefix:
4658
4659 55/push-ebp
4660 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4661
4662 b8/copy-to-eax "+ 03)"/imm32
4663 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4664 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4665 05/add-to-eax 4/imm32
4666
4667 51/push-ecx
4668 50/push-eax
4669 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4670
4671
4672 51/push-ecx
4673
4674 e8/call next-hex-int/disp32
4675
4676 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4677
4678
4679 68/push "F - test-next-hex-int-0-prefix"/imm32
4680 68/push 3/imm32
4681 50/push-eax
4682
4683 e8/call check-ints-equal/disp32
4684
4685 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4686
4687 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4688 5d/pop-to-ebp
4689 c3/return
4690
4691 test-next-hex-int-negative:
4692
4693 55/push-ebp
4694 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4695
4696 b8/copy-to-eax "-03)"/imm32
4697 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4698 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4699 05/add-to-eax 4/imm32
4700
4701 51/push-ecx
4702 50/push-eax
4703 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4704
4705
4706 51/push-ecx
4707
4708 e8/call next-hex-int/disp32
4709
4710 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4711
4712
4713 68/push "F - test-next-hex-int-negative"/imm32
4714 68/push -3/imm32
4715 50/push-eax
4716
4717 e8/call check-ints-equal/disp32
4718
4719 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4720
4721 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4722 5d/pop-to-ebp
4723 c3/return
4724
4725 test-next-hex-int-negative-with-space:
4726
4727 55/push-ebp
4728 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4729
4730 b8/copy-to-eax "- 03)"/imm32
4731 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4732 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4733 05/add-to-eax 4/imm32
4734
4735 51/push-ecx
4736 50/push-eax
4737 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4738
4739
4740 51/push-ecx
4741
4742 e8/call next-hex-int/disp32
4743
4744 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4745
4746
4747 68/push "F - test-next-hex-int-negative-with-space"/imm32
4748 68/push -3/imm32
4749 50/push-eax
4750
4751 e8/call check-ints-equal/disp32
4752
4753 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4754
4755 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4756 5d/pop-to-ebp
4757 c3/return
4758
4759
4760
4761
4762 next-positive-hex-int:
4763
4764 55/push-ebp
4765 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4766
4767 51/push-ecx
4768 52/push-edx
4769 53/push-ebx
4770 56/push-esi
4771 57/push-edi
4772
4773 31/xor 3/mod/direct 7/rm32/edi . . . 7/r32/edi . .
4774
4775 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
4776
4777 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 4/disp8 .
4778
4779 8b/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
4780
4781 31/xor 3/mod/direct 3/rm32/ebx . . . 3/r32/ebx . .
4782
4783 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4784 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4785 $next-positive-hex-int:initial-0:
4786
4787
4788 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4789 3d/compare-eax-and 0x30/imm32/0
4790 75/jump-if-not-equal $next-positive-hex-int:loop/disp8
4791
4792 41/increment-ecx
4793 $next-positive-hex-int:initial-0x:
4794
4795 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4796 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8
4797
4798 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . .
4799 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4800 3d/compare-eax-and 0x78/imm32/x
4801 75/jump-if-not-equal $next-positive-hex-int:loop/disp8
4802
4803 41/increment-ecx
4804 $next-positive-hex-int:loop:
4805
4806 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
4807 73/jump-if-greater-or-equal-unsigned $next-positive-hex-int:end/disp8
4808
4809
4810 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4811
4812
4813 50/push-eax
4814
4815 e8/call is-hex-digit?/disp32
4816
4817 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4818
4819 3d/compare-eax-and 0/imm32
4820 74/jump-if-equal $next-positive-hex-int:end/disp8
4821
4822
4823 8a/copy-byte 0/mod/indirect 1/rm32/ecx . . . 0/r32/AL . .
4824
4825 e8/call from-hex-char/disp32
4826
4827 c1/shift 4/subop/left 3/mod/direct 7/rm32/edi . . . . . 4/imm8
4828 01/add 3/mod/direct 7/rm32/edi . . . 0/r32/eax . .
4829
4830 41/increment-ecx
4831
4832 eb/jump $next-positive-hex-int:loop/disp8
4833 $next-positive-hex-int:end:
4834
4835 89/copy 0/mod/indirect 6/rm32/esi . . . 1/r32/ecx . .
4836
4837 89/copy 3/mod/direct 0/rm32/eax . . . 7/r32/edi . .
4838
4839 5f/pop-to-edi
4840 5e/pop-to-esi
4841 5b/pop-to-ebx
4842 5a/pop-to-edx
4843 59/pop-to-ecx
4844
4845 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4846 5d/pop-to-ebp
4847 c3/return
4848
4849 test-next-positive-hex-int-single-digit:
4850
4851 55/push-ebp
4852 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4853
4854 b8/copy-to-eax "a)"/imm32
4855 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4856 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4857 05/add-to-eax 4/imm32
4858
4859 51/push-ecx
4860 50/push-eax
4861 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4862
4863
4864 51/push-ecx
4865
4866 e8/call next-positive-hex-int/disp32
4867
4868 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4869
4870
4871 68/push "F - test-next-positive-hex-int-single-digit"/imm32
4872 68/push 0xa/imm32
4873 50/push-eax
4874
4875 e8/call check-ints-equal/disp32
4876
4877 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4878
4879 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4880 5d/pop-to-ebp
4881 c3/return
4882
4883 test-next-positive-hex-int-multi-digit:
4884
4885 55/push-ebp
4886 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4887
4888 b8/copy-to-eax "34a)"/imm32
4889 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4890 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4891 05/add-to-eax 4/imm32
4892
4893 51/push-ecx
4894 50/push-eax
4895 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4896
4897
4898 51/push-ecx
4899
4900 e8/call next-positive-hex-int/disp32
4901
4902 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4903
4904
4905 68/push "F - test-next-positive-hex-int-multi-digit"/imm32
4906 68/push 0x34a/imm32
4907 50/push-eax
4908
4909 e8/call check-ints-equal/disp32
4910
4911 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4912
4913 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4914 5d/pop-to-ebp
4915 c3/return
4916
4917 test-next-positive-hex-int-0x-prefix:
4918
4919 55/push-ebp
4920 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4921
4922 b8/copy-to-eax "0x34)"/imm32
4923 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4924 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4925 05/add-to-eax 4/imm32
4926
4927 51/push-ecx
4928 50/push-eax
4929 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4930
4931
4932 51/push-ecx
4933
4934 e8/call next-positive-hex-int/disp32
4935
4936 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4937
4938
4939 68/push "F - test-next-positive-hex-int-0x-prefix"/imm32
4940 68/push 0x34/imm32
4941 50/push-eax
4942
4943 e8/call check-ints-equal/disp32
4944
4945 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4946
4947 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4948 5d/pop-to-ebp
4949 c3/return
4950
4951 test-next-positive-hex-int-zero:
4952
4953 55/push-ebp
4954 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4955
4956 b8/copy-to-eax "0"/imm32
4957 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4958 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4959 05/add-to-eax 4/imm32
4960
4961 51/push-ecx
4962 50/push-eax
4963 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4964
4965
4966 51/push-ecx
4967
4968 e8/call next-positive-hex-int/disp32
4969
4970 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
4971
4972
4973 68/push "F - test-next-positive-hex-int-zero"/imm32
4974 68/push 0/imm32
4975 50/push-eax
4976
4977 e8/call check-ints-equal/disp32
4978
4979 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
4980
4981 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
4982 5d/pop-to-ebp
4983 c3/return
4984
4985 test-next-positive-hex-int-0-prefix:
4986
4987 55/push-ebp
4988 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
4989
4990 b8/copy-to-eax "03)"/imm32
4991 8b/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . .
4992 8d/copy-address 1/mod/*+disp8 4/rm32/sib 0/base/eax 1/index/ecx . 1/r32/ecx 4/disp8 .
4993 05/add-to-eax 4/imm32
4994
4995 51/push-ecx
4996 50/push-eax
4997 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
4998
4999
5000 51/push-ecx
5001
5002 e8/call next-positive-hex-int/disp32
5003
5004 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
5005
5006
5007 68/push "F - test-next-positive-hex-int-0-prefix"/imm32
5008 68/push 3/imm32
5009 50/push-eax
5010
5011 e8/call check-ints-equal/disp32
5012
5013 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
5014
5015 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
5016 5d/pop-to-ebp
5017 c3/return
5018
5019 == data
5020 Registers:
5021
5022 0x40/imm32/write
5023 0/imm32/read
5024 0x40/imm32/length
5025
5026 "eax"/imm32 0/imm32
5027 "ecx"/imm32 1/imm32
5028 "edx"/imm32 2/imm32
5029 "ebx"/imm32 3/imm32
5030 "esp"/imm32 4/imm32
5031 "ebp"/imm32 5/imm32
5032 "esi"/imm32 6/imm32
5033 "edi"/imm32 7/imm32
5034
5035