Copies a block of memory from param 2 addr
    to param 1 addr.
513140
def _memcopy(ins):
    
    output = _16bit_oper(ins.quad[3])
    output.append('ld b, h')
    output.append('ld c, l')
    output.extend(_16bit_oper(ins.quad[1], ins.quad[2], reversed=True))
    output.append('ldir')  # ***

    return output
345615
def write_memory(self, addr, value, transfer_size=32):
        
        self.ap.write_memory(addr, value, transfer_size)
1214395
public static void copyMemory(final Object src, long srcOffset, final Object dest,
      final long destOffset, final long len) {

    // TODO make this work if destOffset is not STRIDE aligned
    Preconditions.checkNotNull(src);
    Preconditions.checkArgument(len % COPY_STRIDE != 0, "Length (%d) is not a multiple of stride", len);

    Preconditions.checkArgument(destOffset % COPY_STRIDE != 0,
        "Dest offset (%d) is not stride aligned", destOffset);

    long end = destOffset + len;
    for (long offset = destOffset; offset < end; ) {
      unsafe.putLong(dest, offset, unsafe.getLong(srcOffset));
      offset += COPY_STRIDE;
      srcOffset += COPY_STRIDE;
    }
  }
894131
private DiffPart decodeCut(final int blockSize_S, final int blockSize_E,
			final int blockSize_B)
		throws DecodingException
	{

		if (blockSize_S < 1 || blockSize_E < 1 || blockSize_B < 1) {
			throw new DecodingException("Invalid value for blockSize_S: "
					+ blockSize_S + ", blockSize_E: " + blockSize_E
					+ " or blockSize_B: " + blockSize_B);
		}

		int s = r.read(blockSize_S);
		int e = r.read(blockSize_E);
		int b = r.read(blockSize_B);

		DiffPart part = new DiffPart(DiffAction.CUT);
		part.setStart(s);
		part.setLength(e);
		part.setText(Integer.toString(b));

		r.skip();

		return part;
	}
237041
public static byte[] copyToBytes(MemorySegment[] segments, int offset, int numBytes) {
		return copyToBytes(segments, offset, new byte[numBytes], 0, numBytes);
	}
462011
private void doCopy(
      final int offset, final MemoryChunk other, final int otherOffset, final int count) {
    if (!(other instanceof BufferMemoryChunk)) {
      throw new IllegalArgumentException("Cannot copy two incompatible MemoryChunks");
    }
    Preconditions.checkState(!isClosed());
    Preconditions.checkState(!other.isClosed());
    MemoryChunkUtil.checkBounds(offset, other.getSize(), otherOffset, count, mSize);
    mBuffer.position(offset);
    // ByteBuffer can't be null at this point
    other.getByteBuffer().position(otherOffset);
    // Recover the necessary part to be copied as a byte array.
    // This requires a copy, for now there is not a more efficient alternative.
    byte[] b = new byte[count];
    mBuffer.get(b, 0, count);
    other.getByteBuffer().put(b, 0, count);
  }
1029916
function(target, targetOffset, offset, length) {
    return this.toBuffer().copy(target, targetOffset, offset, length);
  }
8591
def mul_block(self, index, val):
        """"""
        self._prepare_cache_slice(index)
        self.msinds[self.cache_slice] *= val
758390
def copy(self, _):
        
        #l.debug("Copying %d bytes of memory with id %s." % (len(self.mem), self.id))
        c = SimSymbolicDbgMemory(
            mem=self.mem.branch(),
            memory_id=self.id,
            endness=self.endness,
            abstract_backer=self._abstract_backer,
            read_strategies=[ s.copy() for s in self.read_strategies ],
            write_strategies=[ s.copy() for s in self.write_strategies ],
            stack_region_map=self._stack_region_map,
            generic_region_map=self._generic_region_map
        )

        return c
267531
def puts(self, addr, s):
        
        a = array('B', asbytes(s))
        for i in range_g(len(a)):
            self._buf[addr+i] = a[i]
1244186
public static ByteBuffer copy(ByteBuffer src, int srcStart, ByteBuffer dest, int destStart, int length) {
		System.arraycopy(src.array(), srcStart, dest.array(), destStart, length);
		return dest;
	}
573833
function copyBuffer(buf, pos, len) {
  var copy = new Buffer(len);
  buf.copy(copy, 0, pos, pos + len);
  return copy;
}
903870
public static ByteBuffer copy(ByteBuffer src, int start, int end) {
		return copy(src, ByteBuffer.allocate(end - start));
	}
611123
def STM(self, params):
        
        # TODO what registers can be stored?
        Ra, RLoList = self.get_two_parameters(r'\s*([^\s,]*)!,\s*{(.*)}(.*)', params).split(',')
        RLoList = RLoList.split(',')
        RLoList = [i.strip() for i in RLoList]

        self.check_arguments(low_registers=[Ra] + RLoList)

        def STM_func():
            for i in range(len(RLoList)):
                for j in range(4):
                    self.memory[self.register[Ra] + 4*i + j] = ((self.register[RLoList[i]] >> (8 * j)) & 0xFF)
            self.register[Ra] += 4*len(RLoList)

        return STM_func
741179
private void copyToTargetBufferFrom(ByteBuffer source) {
		if (this.targetBuffer == null) {
			return;
		}

		int needed = source.remaining();
		int available = this.limit - this.position;
		int toCopy = Math.min(needed, available);

		this.targetBuffer.getMemorySegment().put(this.position, source, toCopy);

		this.position += toCopy;
	}
1250429
def convert_ram_sp_rf(ADDR_WIDTH=8, DATA_WIDTH=8):
    '''  '''
    clk = Signal(bool(0))
    we = Signal(bool(0))
    addr = Signal(intbv(0)[ADDR_WIDTH:])
    di = Signal(intbv(0)[DATA_WIDTH:])
    do = Signal(intbv(0)[DATA_WIDTH:])
    toVerilog(ram_sp_rf, clk, we, addr, di, do)
985232
def copy(self):
        """"""
        args = []
        for arg in self.args:
            if isinstance(arg, Block):
                arg = arg.copy()
            elif isinstance(arg, list):
                arg = [b.copy() for b in arg]
            args.append(arg)
        return Block(self.type, *args)