Пример #1
0
 public static void AuxDepth(Forth f)
 {
     f.PushInt64((long)(f.aStack.Depth));
 }
Пример #2
0
 public static void OnePlus(Forth f)
 {
     long x = f.PopInt64();
     f.PushInt64(x + 1L);
 }
Пример #3
0
 public static void OneMinus(Forth f)
 {
     long x = f.PopInt64();
     f.PushInt64(x - 1L);
 }
Пример #4
0
 public static void Here(Forth f)
 {
     f.PushInt64((long)(f.here));
 }
Пример #5
0
 public void RefForward(Forth f)
 {
     f.PushInt64((long)Here);
     Add(null);
 }
Пример #6
0
 public static void Subtract(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a - b));
 }
Пример #7
0
 public static void Divide(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a / b));
 }
Пример #8
0
 public static void Int32At(Forth f)
 {
     long offset = f.PopInt64();
     uint l = unchecked((uint)f.byteMemory.ReadInt32(checked((int)offset)));
     f.PushInt64((long)l);
 }
Пример #9
0
 public static void Int64At(Forth f)
 {
     long offset = f.PopInt64();
     long l = f.byteMemory.ReadInt64(checked((int)offset));
     f.PushInt64(l);
 }
Пример #10
0
 public static void ByteAt(Forth f)
 {
     long offset = f.PopInt64();
     byte b = f.byteMemory[checked((int)offset)];
     f.PushInt64((long)b);
 }
Пример #11
0
 public static void Int16At(Forth f)
 {
     long offset = f.PopInt64();
     ushort u = unchecked((ushort)f.byteMemory.ReadInt16(checked((int)offset)));
     f.PushInt64((long)u);
 }
Пример #12
0
 public static void RealAddress(Forth f)
 {
     object obj = f.dStack.Pop();
     MemoryAccessor ma = (MemoryAccessor)obj;
     f.PushInt64(ma.RealAddress);
 }
Пример #13
0
 public static void ByteArraySize(Forth f)
 {
     byte[] bArr = f.PopByteArray();
     f.PushInt64((long)(bArr.Length));
 }
Пример #14
0
 public static void ByteArrayAt(Forth f)
 {
     byte[] bArr = f.PopByteArray();
     long index = f.PopInt64();
     if (index < 0 || index > ((long)(bArr.Length))) throw new IndexOutOfRangeException("Index " + index + " must be 0 to " + bArr.Length);
     f.PushInt64((long)(bArr[(int)index]));
 }
Пример #15
0
 public static void Negate(Forth f)
 {
     long l = f.PopInt64();
     f.PushInt64(unchecked(-l));
 }
Пример #16
0
 public static void ByteHereOp(Forth f)
 {
     f.PushInt64((long)f.byteHere);
 }
Пример #17
0
 public static void Add(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a + b));
 }
Пример #18
0
 public static void ByteMemorySize(Forth f)
 {
     f.PushInt64(f.byteMemory.Size);
 }
Пример #19
0
 public static void Multiply(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a * b));
 }
Пример #20
0
 public static void ByteMemoryUnused(Forth f)
 {
     f.PushInt64(f.byteMemory.Size - f.byteHere);
 }
Пример #21
0
 public static void Modulus(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a % b));
 }
Пример #22
0
 public static void Max(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64((a > b) ? a : b);
 }
Пример #23
0
 public static void Unused(Forth f)
 {
     f.PushInt64((long)(f.memory.Length - f.here));
 }
Пример #24
0
 public void LabelBack(Forth f)
 {
     f.PushInt64((long)Here);
 }