public override void Run(NCSContext context) { int offset = int.Parse(args[1]); int value = ((int)context.GetOffsetSP(offset)) + 1; context.SetOffsetSP(offset, value); }
// Copy the given number of bytes from the location specified in the stack to the top of the stack. public override void Run(NCSContext context) { int start = int.Parse(args[1]); // This should always be a multiple of 4 int size = int.Parse(args[2]); // This should always be a multiple of 4 while (size > 0) { // We don't add (+ 4 * i) because every time we push to the stack the top gets pushed up; // i..e the + 4 to the offset happens for us when we push to the stack, since the position is relative int offset = start; object value = context.GetOffsetSP(offset); context.Push(value); size -= 4; } }
public override void Run(NCSContext context) { int offset = int.Parse(args[1]); int size = int.Parse(args[2]); int startPos = -size; while (size > 0) { object value = context.GetOffsetSP(startPos); context.SetOffsetSP(offset, value); startPos += 4; offset += 4; size -= 4; } }
public override void Run(NCSContext context) { // Copy the given number of bytes from the base pointer // down to the location specified. int offset = int.Parse(args[1]) - 4; int size = int.Parse(args[2]); int startPos = -size; while (size > 0) { object val = context.GetOffsetSP(startPos); context.SetOffsetBP(offset, val); startPos += 4; offset += 4; size -= 4; } }