Exemplo n.º 1
0
 public static void AuxDepth(Forth f)
 {
     f.PushInt64((long)(f.aStack.Depth));
 }
Exemplo n.º 2
0
 public static void OnePlus(Forth f)
 {
     long x = f.PopInt64();
     f.PushInt64(x + 1L);
 }
Exemplo n.º 3
0
 public static void OneMinus(Forth f)
 {
     long x = f.PopInt64();
     f.PushInt64(x - 1L);
 }
Exemplo n.º 4
0
 public static void Here(Forth f)
 {
     f.PushInt64((long)(f.here));
 }
Exemplo n.º 5
0
 public void RefForward(Forth f)
 {
     f.PushInt64((long)Here);
     Add(null);
 }
Exemplo n.º 6
0
 public static void Subtract(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a - b));
 }
Exemplo n.º 7
0
 public static void Divide(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a / b));
 }
Exemplo n.º 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);
 }
Exemplo n.º 9
0
 public static void Int64At(Forth f)
 {
     long offset = f.PopInt64();
     long l = f.byteMemory.ReadInt64(checked((int)offset));
     f.PushInt64(l);
 }
Exemplo n.º 10
0
 public static void ByteAt(Forth f)
 {
     long offset = f.PopInt64();
     byte b = f.byteMemory[checked((int)offset)];
     f.PushInt64((long)b);
 }
Exemplo n.º 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);
 }
Exemplo n.º 12
0
 public static void RealAddress(Forth f)
 {
     object obj = f.dStack.Pop();
     MemoryAccessor ma = (MemoryAccessor)obj;
     f.PushInt64(ma.RealAddress);
 }
Exemplo n.º 13
0
 public static void ByteArraySize(Forth f)
 {
     byte[] bArr = f.PopByteArray();
     f.PushInt64((long)(bArr.Length));
 }
Exemplo n.º 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]));
 }
Exemplo n.º 15
0
 public static void Negate(Forth f)
 {
     long l = f.PopInt64();
     f.PushInt64(unchecked(-l));
 }
Exemplo n.º 16
0
 public static void ByteHereOp(Forth f)
 {
     f.PushInt64((long)f.byteHere);
 }
Exemplo n.º 17
0
 public static void Add(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a + b));
 }
Exemplo n.º 18
0
 public static void ByteMemorySize(Forth f)
 {
     f.PushInt64(f.byteMemory.Size);
 }
Exemplo n.º 19
0
 public static void Multiply(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a * b));
 }
Exemplo n.º 20
0
 public static void ByteMemoryUnused(Forth f)
 {
     f.PushInt64(f.byteMemory.Size - f.byteHere);
 }
Exemplo n.º 21
0
 public static void Modulus(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64(unchecked(a % b));
 }
Exemplo n.º 22
0
 public static void Max(Forth f)
 {
     long b = f.PopInt64();
     long a = f.PopInt64();
     f.PushInt64((a > b) ? a : b);
 }
Exemplo n.º 23
0
 public static void Unused(Forth f)
 {
     f.PushInt64((long)(f.memory.Length - f.here));
 }
Exemplo n.º 24
0
 public void LabelBack(Forth f)
 {
     f.PushInt64((long)Here);
 }