예제 #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);
 }