about summary refs log tree commit diff stats
path: root/subx/069slice.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-01-10 17:07:55 -0800
committerKartik Agaram <vc@akkartik.com>2019-01-10 17:07:55 -0800
commit5a2e541c181d6ef75c31b98084f5c23551aa6d3a (patch)
tree735a9565769f61f9bbc0deccb68b6b86f2208163 /subx/069slice.subx
parent8b9dd2d1a9a86eb2bca7b67cb6bd4b707d63c042 (diff)
downloadmu-5a2e541c181d6ef75c31b98084f5c23551aa6d3a.tar.gz
4917
Diffstat (limited to 'subx/069slice.subx')
-rw-r--r--subx/069slice.subx140
1 files changed, 0 insertions, 140 deletions
diff --git a/subx/069slice.subx b/subx/069slice.subx
index dda19ad8..ef45e508 100644
--- a/subx/069slice.subx
+++ b/subx/069slice.subx
@@ -6,123 +6,6 @@
 # . op          subop               mod             rm32          base        index         scale       r32
 # . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
 
-#? e8/call test-write-byte-multiple-flushes/disp32
-#? #? e8/call test-foo/disp32
-#? #? e8/call test-slice-equal/disp32
-#? bb/copy-to-EBX  0/imm32
-#? b8/copy-to-EAX  1/imm32/exit
-#? cd/syscall  0x80/imm8
-
-#? # stop directly - seems fine
-#? # error-byte - writing out of bounds
-#? #   drop stop - writing out of bounds
-#? 
-#? test-foo:
-#?     # This test uses exit-descriptors. Use EBP for setting up local variables.
-#?     55/push-EBP
-#?     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-#?     # initialize '_test-stream' to "a"
-#?     # . write(_test-stream, "a")
-#?     # . . push args
-#?     68/push  "a"/imm32
-#?     68/push  _test-stream/imm32
-#?     # . . call
-#?     e8/call  write/disp32
-#?     # . . discard args
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-#?     # initialize exit-descriptor 'ed' for the call to 'convert-next-octet' below
-#?     # . var ed/ECX : exit-descriptor
-#?     81          5/subop/subtract    3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # subtract from ESP
-#?     89/copy                         3/mod/direct    1/rm32/ECX    .           .             .           4/r32/ESP   .               .                 # copy ESP to ECX
-#?     # . tailor-exit-descriptor(ed, 12)
-#?     # . . push args
-#?     68/push  0xc/imm32/nbytes-of-args-for-convert-next-octet
-#?     51/push-ECX/ed
-#?     # . . call
-#?     e8/call  tailor-exit-descriptor/disp32
-#?     # . . discard args
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-#?     # EAX = foo(_test-buffered-file, _test-error-buffered-file, ed)
-#?     # . . push args
-#?     51/push-ECX/ed
-#?     68/push  _test-foo-error-buffered-file/imm32
-#?     68/push  _test-buffered-file/imm32
-#?     # . . call
-#?     e8/call  foo/disp32
-#?     # registers except ESP may be clobbered at this point
-#?     # pop args to convert-next-octet
-#?     # . . discard first 2 args
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-#?     # . . restore ed
-#?     59/pop-to-ECX
-#?     # . epilog
-#?     # don't restore ESP from EBP; manually reclaim locals
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-#?     5d/pop-to-EBP
-#?     c3/return
-#? 
-#? foo:  # in : (address buffered-file), err : (address buffered-file), ed : (address exit-descriptor) -> byte-or-eof/EAX
-#?     # . prolog
-#?     55/push-EBP
-#?     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-#?     # . foo-error-byte(ed, err, msg, '.')
-#?     # . . push args
-#?     68/push  0x2e/imm32/period/dummy
-#?     68/push  "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"/imm32
-#?     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0xc/disp8       .                 # push *(EBP+12)
-#?     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0x10/disp8      .                 # push *(EBP+16)
-#?     # . . call
-#?     e8/call  foo-error-byte/disp32  # never returns
-#?     # . . discard args
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               0x10/imm32        # add to ESP
-#?     # . epilog
-#?     89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
-#?     5d/pop-to-EBP
-#?     c3/return
-#? 
-#? # write(out, "Error: "+msg+": "+byte) then stop(ed, 1)
-#? foo-error-byte:  # ed : (address exit-descriptor), out : (address buffered-file), msg : (address array byte), n : byte -> <void>
-#?     # . prolog
-#?     55/push-EBP
-#?     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-#?     # write-buffered(out, "Error: ")
-#?     # . . push args
-#?     68/push  "Error: "/imm32
-#?     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0xc/disp8       .                 # push *(EBP+12)
-#?     # . . call
-#?     e8/call  write-buffered/disp32
-#?     # . . discard args
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-#?     # write-buffered(out, msg)
-#?     # . . push args
-#?     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0x10/disp8      .                 # push *(EBP+16)
-#?     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0xc/disp8       .                 # push *(EBP+12)
-#?     # . . call
-#?     e8/call  write-buffered/disp32
-#?     # . . discard args
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-#?     # write-buffered(out, ": ")
-#?     # . . push args
-#?     68/push  ": "/imm32
-#?     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0xc/disp8       .                 # push *(EBP+12)
-#?     # . . call
-#?     e8/call  write-buffered/disp32
-#?     # . . discard args
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-#?     # print-byte(out, byte)
-#?     # . . push args
-#?     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0x14/disp8      .                 # push *(EBP+20)
-#?     ff          6/subop/push        1/mod/*+disp8   5/rm32/EBP    .           .             .           .           0xc/disp8       .                 # push *(EBP+12)
-#?     # . . call
-#?     e8/call  print-byte/disp32
-#?     # . . discard args
-#?     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
-#? $foo-error-byte:dead-end:
-#?     # . epilog
-#?     89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
-#?     5d/pop-to-EBP
-#?     c3/return
-
 # main:
     e8/call  run-tests/disp32  # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'.
     # syscall(exit, Num-test-failures)
@@ -490,29 +373,6 @@ test-slice-equal-empty-with-empty:
 
 == data
 
-#? _test-foo-error-stream:
-#?     # current write index
-#?     00 00 00 00
-#?     # current read index
-#?     00 00 00 00
-#?     # length (= 8)
-#?     08 00 00 00
-#?     # data
-#?     00 00 00 00 00 00 00 00  # 8 bytes
-#? 
-#? # a test buffered file for _test-stream
-#? _test-foo-error-buffered-file:
-#?     # file descriptor or (address stream)
-#?     _test-foo-error-stream/imm32
-#?     # current write index
-#?     00 00 00 00
-#?     # current read index
-#?     00 00 00 00
-#?     # length (6)
-#?     06 00 00 00
-#?     # data
-#?     00 00 00 00 00 00  # 6 bytes
-
 _test-slice-data-0:
     41/A
 _test-slice-data-1:
n491' href='#n491'>491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939