public static int Set(Processor proc, ProgramReader reader) { int sourceSize = reader.NextInt(); byte[] source = reader.NextArray(sourceSize); uint dest = reader.NextPtr(); MemoryReader r = MemoryReader.GetReader(0, proc, source, sourceSize); MemoryWriter w = MemoryWriter.GetWriter(1, proc, dest); w.Write(r.Data); return(reader.Elapsed()); }
public static int AssignOperationRegister(Processor proc, ProgramReader reader) { int id = reader.NextInt(); int size = reader.NextInt(); byte[] ptr = reader.NextArray(Defines.SIZE_PTR); byte[] reg = new byte[size]; MemoryReader r = MemoryReader.GetReader(id, proc, ptr, Defines.SIZE_PTR); Array.Copy(r.Data, 0, reg, 0, size); proc.Registers.OperationRegisters[id] = reg; return(reader.Elapsed()); }