• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/bearssl/T0/

Lines Matching refs:cpu

310 		AddNative("add-cc:", false, SType.BLANK, cpu => {
330 AddNative("cc:", false, SType.BLANK, cpu => {
354 AddNative("preamble", false, SType.BLANK, cpu => {
363 AddNative("postamble", false, SType.BLANK, cpu => {
374 AddNative("make-CX", false, new SType(3, 1), cpu => {
375 TValue c = cpu.Pop();
380 int max = cpu.Pop();
381 int min = cpu.Pop();
384 cpu.Push(tv);
396 AddNative("CX", true, cpu => {
417 cpu.Push(tv);
426 AddNative("co", false, SType.BLANK, cpu => {
438 AddNative(":", false, cpu => {
479 AddNative("define-word", false, cpu => {
480 int dout = cpu.Pop();
481 int din = cpu.Pop();
482 TValue s = cpu.Pop();
503 AddNative(";", true, cpu => {
527 AddNative("immediate", false, cpu => {
540 WordNative wliteral = AddNative("literal", true, cpu => {
542 wordBuilder.Literal(cpu.Pop());
551 WordNative wcompile = AddNative("compile", false, cpu => {
553 wordBuilder.Call(cpu.Pop().ToXT());
562 AddNative("postpone", true, cpu => {
598 AddNative("exitvm", false, cpu => {
606 AddNative("new-data-block", false, cpu => {
608 cpu.Push(new TValue(0, new TPointerBlob(dataBlock)));
615 AddNative("define-data-word", false, cpu => {
616 string name = cpu.Pop().ToString();
617 TValue va = cpu.Pop();
637 AddNative("current-data", false, cpu => {
642 cpu.Push(new TValue(dataBlock.Length,
649 AddNative("data-add8", false, cpu => {
654 int v = cpu.Pop();
665 AddNative("data-set8", false, cpu => {
666 TValue va = cpu.Pop();
672 int v = cpu.Pop();
683 AddNative("data-get8", false, new SType(1, 1), cpu => {
684 TValue va = cpu.Pop();
691 cpu.Push(v);
697 AddNative("compile-local-read", false, cpu => {
699 wordBuilder.GetLocal(cpu.Pop().ToString());
701 AddNative("compile-local-write", false, cpu => {
703 wordBuilder.PutLocal(cpu.Pop().ToString());
706 AddNative("ahead", true, cpu => {
710 AddNative("begin", true, cpu => {
714 AddNative("again", true, cpu => {
718 AddNative("until", true, cpu => {
722 AddNative("untilnot", true, cpu => {
726 AddNative("if", true, cpu => {
730 AddNative("ifnot", true, cpu => {
734 AddNative("then", true, cpu => {
738 AddNative("cs-pick", false, cpu => {
740 wordBuilder.CSPick(cpu.Pop());
742 AddNative("cs-roll", false, cpu => {
744 wordBuilder.CSRoll(cpu.Pop());
746 AddNative("next-word", false, cpu => {
751 cpu.Push(StringToBlob(s));
753 AddNative("parse", false, cpu => {
754 int d = cpu.Pop();
756 cpu.Push(StringToBlob(s));
758 AddNative("char", false, cpu => {
763 cpu.Push(c);
765 AddNative("'", false, cpu => {
767 cpu.Push(new TValue(0, new TPointerXT(name)));
775 AddNative("execute", false, cpu => {
776 cpu.Pop().Execute(this, cpu);
779 AddNative("[", true, cpu => {
783 AddNative("]", false, cpu => {
786 AddNative("(local)", false, cpu => {
788 wordBuilder.DefLocal(cpu.Pop().ToString());
790 AddNative("ret", true, cpu => {
795 AddNative("drop", false, new SType(1, 0), cpu => {
796 cpu.Pop();
798 AddNative("dup", false, new SType(1, 2), cpu => {
799 cpu.Push(cpu.Peek(0));
801 AddNative("swap", false, new SType(2, 2), cpu => {
802 cpu.Rot(1);
804 AddNative("over", false, new SType(2, 3), cpu => {
805 cpu.Push(cpu.Peek(1));
807 AddNative("rot", false, new SType(3, 3), cpu => {
808 cpu.Rot(2);
810 AddNative("-rot", false, new SType(3, 3), cpu => {
811 cpu.NRot(2);
822 AddNative("roll", false, new SType(1, 0), cpu => {
823 cpu.Rot(cpu.Pop());
825 AddNative("pick", false, new SType(1, 1), cpu => {
826 cpu.Push(cpu.Peek(cpu.Pop()));
829 AddNative("+", false, new SType(2, 1), cpu => {
830 TValue b = cpu.Pop();
831 TValue a = cpu.Pop();
834 cpu.Push(a);
838 cpu.Push(StringToBlob(
845 AddNative("-", false, new SType(2, 1), cpu => {
852 TValue b = cpu.Pop();
853 TValue a = cpu.Pop();
857 cpu.Push(new TValue(a.x - b.x));
862 cpu.Push(a);
864 AddNative("neg", false, new SType(1, 1), cpu => {
865 int ax = cpu.Pop();
866 cpu.Push(-ax);
868 AddNative("*", false, new SType(2, 1), cpu => {
869 int bx = cpu.Pop();
870 int ax = cpu.Pop();
871 cpu.Push(ax * bx);
873 AddNative("/", false, new SType(2, 1), cpu => {
874 int bx = cpu.Pop();
875 int ax = cpu.Pop();
876 cpu.Push(ax / bx);
878 AddNative("u/", false, new SType(2, 1), cpu => {
879 uint bx = cpu.Pop();
880 uint ax = cpu.Pop();
881 cpu.Push(ax / bx);
883 AddNative("%", false, new SType(2, 1), cpu => {
884 int bx = cpu.Pop();
885 int ax = cpu.Pop();
886 cpu.Push(ax % bx);
888 AddNative("u%", false, new SType(2, 1), cpu => {
889 uint bx = cpu.Pop();
890 uint ax = cpu.Pop();
891 cpu.Push(ax % bx);
893 AddNative("<", false, new SType(2, 1), cpu => {
894 int bx = cpu.Pop();
895 int ax = cpu.Pop();
896 cpu.Push(ax < bx);
898 AddNative("<=", false, new SType(2, 1), cpu => {
899 int bx = cpu.Pop();
900 int ax = cpu.Pop();
901 cpu.Push(ax <= bx);
903 AddNative(">", false, new SType(2, 1), cpu => {
904 int bx = cpu.Pop();
905 int ax = cpu.Pop();
906 cpu.Push(ax > bx);
908 AddNative(">=", false, new SType(2, 1), cpu => {
909 int bx = cpu.Pop();
910 int ax = cpu.Pop();
911 cpu.Push(ax >= bx);
913 AddNative("=", false, new SType(2, 1), cpu => {
914 TValue b = cpu.Pop();
915 TValue a = cpu.Pop();
916 cpu.Push(a.Equals(b));
918 AddNative("<>", false, new SType(2, 1), cpu => {
919 TValue b = cpu.Pop();
920 TValue a = cpu.Pop();
921 cpu.Push(!a.Equals(b));
923 AddNative("u<", false, new SType(2, 1), cpu => {
924 uint bx = cpu.Pop().UInt;
925 uint ax = cpu.Pop().UInt;
926 cpu.Push(new TValue(ax < bx));
928 AddNative("u<=", false, new SType(2, 1), cpu => {
929 uint bx = cpu.Pop().UInt;
930 uint ax = cpu.Pop().UInt;
931 cpu.Push(new TValue(ax <= bx));
933 AddNative("u>", false, new SType(2, 1), cpu => {
934 uint bx = cpu.Pop().UInt;
935 uint ax = cpu.Pop().UInt;
936 cpu.Push(new TValue(ax > bx));
938 AddNative("u>=", false, new SType(2, 1), cpu => {
939 uint bx = cpu.Pop();
940 uint ax = cpu.Pop();
941 cpu.Push(ax >= bx);
943 AddNative("and", false, new SType(2, 1), cpu => {
944 uint bx = cpu.Pop();
945 uint ax = cpu.Pop();
946 cpu.Push(ax & bx);
948 AddNative("or", false, new SType(2, 1), cpu => {
949 uint bx = cpu.Pop();
950 uint ax = cpu.Pop();
951 cpu.Push(ax | bx);
953 AddNative("xor", false, new SType(2, 1), cpu => {
954 uint bx = cpu.Pop();
955 uint ax = cpu.Pop();
956 cpu.Push(ax ^ bx);
958 AddNative("not", false, new SType(1, 1), cpu => {
959 uint ax = cpu.Pop();
960 cpu.Push(~ax);
962 AddNative("<<", false, new SType(2, 1), cpu => {
963 int count = cpu.Pop();
967 uint ax = cpu.Pop();
968 cpu.Push(ax << count);
970 AddNative(">>", false, new SType(2, 1), cpu => {
971 int count = cpu.Pop();
975 int ax = cpu.Pop();
976 cpu.Push(ax >> count);
978 AddNative("u>>", false, new SType(2, 1), cpu => {
979 int count = cpu.Pop();
983 uint ax = cpu.Pop();
984 cpu.Push(ax >> count);
987 AddNative(".", false, new SType(1, 0), cpu => {
988 Console.Write(" {0}", cpu.Pop().ToString());
990 AddNative(".s", false, SType.BLANK, cpu => {
991 int n = cpu.Depth;
993 Console.Write(" {0}", cpu.Peek(i).ToString());
996 AddNative("putc", false, new SType(1, 0), cpu => {
997 Console.Write((char)cpu.Pop());
999 AddNative("puts", false, new SType(1, 0), cpu => {
1000 Console.Write("{0}", cpu.Pop().ToString());
1002 AddNative("cr", false, SType.BLANK, cpu => {
1005 AddNative("eqstr", false, new SType(2, 1), cpu => {
1006 string s2 = cpu.Pop().ToString();
1007 string s1 = cpu.Pop().ToString();
1008 cpu.Push(s1 == s2);
1404 CPU cpu = new CPU();
1410 cpu.Enter(code, 0);
1415 Opcode op = cpu.ipBuf[cpu.ipOff ++];
1416 op.Run(cpu);
1420 void CompileStep(CPU cpu)
1443 w.Run(cpu);
1452 cpu.Push(v);
1454 w.Run(cpu);