コード例 #1
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void IsNotGreaterThanUnsigned(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushBool(a <= b);
 }
コード例 #2
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void IsNotLessThanUnsigned(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushBool(a >= b);
 }
コード例 #3
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void Equals(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushBool(a == b);
 }
コード例 #4
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void DoesNotEqual(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushBool(a != b);
 }
コード例 #5
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void And(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64(a & b);
 }
コード例 #6
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void Xor(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64(a ^ b);
 }
コード例 #7
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void UnsignedDivide(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64(unchecked(a / b));
 }
コード例 #8
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void UnsignedModulus(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64(unchecked(a % b));
 }
コード例 #9
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void Invert(Forth f)
 {
     ulong u = f.PopUInt64();
     f.PushUInt64(~u);
 }
コード例 #10
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void UnsignedMax(Forth f)
 {
     ulong b = f.PopUInt64();
     ulong a = f.PopUInt64();
     f.PushUInt64((a > b) ? a : b);
 }
コード例 #11
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 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);
     }
 }
コード例 #12
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void ZeroExtendInt32(Forth f)
 {
     ulong value = f.PopUInt64();
     value &= 0xFFFFFFFFul;
     f.PushUInt64(value);
 }
コード例 #13
0
ファイル: Forth.cs プロジェクト: Sunlighter/SimpleForth
 public static void SignExtendInt32(Forth f)
 {
     ulong value = f.PopUInt64();
     if ((value & 0x80000000ul) != 0) value |= 0xFFFFFFFF80000000ul;
     else value &= 0x7FFFFFFFul;
     f.PushUInt64(value);
 }