public static void Int16Bang(Forth f) { long offset = f.PopInt64(); long value = f.PopInt64(); f.byteMemory.WriteInt16(checked((int)offset), unchecked((short)value)); }
public static void At(Forth f) { long index = f.PopInt64(); f.dStack.Push(f.memory[(int)index]); }
public static void Off(Forth f) { long index = f.PopInt64(); f.memory[(int)index] = 0L; }
public static void Modulus(Forth f) { long b = f.PopInt64(); long a = f.PopInt64(); f.PushInt64(unchecked(a % b)); }
public static void IsNotGreaterThan(Forth f) { long b = f.PopInt64(); long a = f.PopInt64(); f.PushBool(a <= b); }
public static void Add(Forth f) { long b = f.PopInt64(); long a = f.PopInt64(); f.PushInt64(unchecked(a + b)); }
public static void Multiply(Forth f) { long b = f.PopInt64(); long a = f.PopInt64(); f.PushInt64(unchecked(a * b)); }
public static void ByteHereReset(Forth f) { long l = f.PopInt64(); f.byteHere = l; }
public static void Max(Forth f) { long b = f.PopInt64(); long a = f.PopInt64(); f.PushInt64((a > b) ? a : b); }
public static void Int32Comma(Forth f) { long value = f.PopInt64(); f.byteMemory.WriteInt32(f.byteHere, unchecked((int)value)); f.byteHere += 4; }
public static void Int64Comma(Forth f) { long value = f.PopInt64(); f.byteMemory.WriteInt64(f.byteHere, value); f.byteHere += 8; }
public static void Int16Comma(Forth f) { long value = f.PopInt64(); f.byteMemory.WriteInt16(f.byteHere, unchecked((short)value)); f.byteHere+=2; }
public static void ByteComma(Forth f) { long value = f.PopInt64(); f.byteMemory[f.byteHere] = unchecked((byte)value); f.byteHere++; }
public static void Int64Bang(Forth f) { long offset = f.PopInt64(); long value = f.PopInt64(); f.byteMemory.WriteInt64(checked((int)offset), value); }
public static void AuxPickBang(Forth f) { long pos = f.PopInt64(); if (pos >= 256 || pos < 0) throw new ArgumentException("apick! too far"); object v = f.dStack.Pop(); f.aStack[(int)pos] = v; }
public static void Dump(Forth f) { long len = f.PopInt64(); long offset = f.PopInt64(); Dump(f.byteMemory, checked((int)offset), checked((int)len)); }
public static void Negate(Forth f) { long l = f.PopInt64(); f.PushInt64(unchecked(-l)); }
public static void DumpArray(Forth f) { byte[] array = (byte[])(f.dStack.Pop()); long len = f.PopInt64(); long offset = f.PopInt64(); Dump(new ByteArrayWrapper(array), checked((int)offset), checked((int)len)); }
public static void Subtract(Forth f) { long b = f.PopInt64(); long a = f.PopInt64(); f.PushInt64(unchecked(a - b)); }
public static void OnePlus(Forth f) { long x = f.PopInt64(); f.PushInt64(x + 1L); }
public static void Divide(Forth f) { long b = f.PopInt64(); long a = f.PopInt64(); f.PushInt64(unchecked(a / b)); }
public static void OneMinus(Forth f) { long x = f.PopInt64(); f.PushInt64(x - 1L); }
public static void Within(Forth f) { long end = f.PopInt64(); long begin = f.PopInt64(); long mid = f.PopInt64(); f.PushBool(Within(begin, mid, end)); }
public static void Alloc(Forth f) { long count = f.PopInt64(); if (count > 256 || count < 0) throw new ArgumentException("alloc too much"); f.dStack.Alloc((int)count); }
public static void IsNotLessThan(Forth f) { long b = f.PopInt64(); long a = f.PopInt64(); f.PushBool(a >= b); }
public static void AuxFree(Forth f) { long count = f.PopInt64(); if (count > 256 || count < 0) throw new ArgumentException("afree too much"); f.aStack.Free((int)count); }
public static void Bang(Forth f) { long index = f.PopInt64(); object v = f.dStack.Pop(); f.memory[(int)index] = v; }
public static void AuxPick(Forth f) { long pos = f.PopInt64(); if (pos >= 256 || pos < 0) throw new ArgumentException("apick too far"); f.dStack.Push(f.aStack[(int)pos]); }
public static void Allot(Forth f) { long amt = f.PopInt64(); if (amt > (long)(f.memory.Length - f.here)) throw new ArgumentOutOfRangeException("Attempt to allot more memory than is available"); f.here += (int)amt; }
public static void ByteBang(Forth f) { long offset = f.PopInt64(); long value = f.PopInt64(); f.byteMemory[checked((int)offset)] = unchecked((byte)value); }