Пример #1
0
 public static void And(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64(a & b);
 }
Пример #2
0
 public static void Xor(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64(a ^ b);
 }
Пример #3
0
 public static void UnsignedDivide(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64(unchecked(a / b));
 }
Пример #4
0
 public static void UnsignedModulus(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64(unchecked(a % b));
 }
Пример #5
0
 public static void Invert(Forth f)
 {
     ulong u = f.PopUInt64();
     f.PushUInt64(~u);
 }
Пример #6
0
 public static void UnsignedMax(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64((a > b) ? a : b);
 }
Пример #7
0
 public static void RShift(Forth f)
 {
     ulong shiftCount = f.PopUInt64();
     ulong value = f.PopUInt64();
     if (shiftCount > 63)
     {
         f.PushUInt64(0ul);
     }
     else
     {
         f.PushUInt64(value >> (int)shiftCount);
     }
 }
Пример #8
0
 public static void ZeroExtendInt32(Forth f)
 {
     ulong value = f.PopUInt64();
     value &= 0xFFFFFFFFul;
     f.PushUInt64(value);
 }
Пример #9
0
 public static void SignExtendInt32(Forth f)
 {
     ulong value = f.PopUInt64();
     if ((value & 0x80000000ul) != 0) value |= 0xFFFFFFFF80000000ul;
     else value &= 0x7FFFFFFFul;
     f.PushUInt64(value);
 }