public static void memcpy(int addr, byte[] bytes, int off, int size) { while (((addr & 0x3) != 0) && (size > 0)) { byte b = bytes[off++]; CRunTime.memoryWriteByte(addr, b); addr++; size--; if (size == 0) { return; } } while (size > 3) { int i = 0; for (int j = 0; j < 4; j++) { i = i << 8; int b = bytes[off++] & 0xff; i |= b; } CRunTime.memoryWriteWord(addr, i); addr += 4; size -= 4; } while (size > 0) { byte b = bytes[off++]; CRunTime.memoryWriteByte(addr, b); addr++; size--; } }
public int findTile(int fips, int tile_index, int size_addr) { for (int i = 1; i < numRecords; i++) { if (ids[i] == tile_index) { if (size_addr != 0) { try { CRunTime.memoryWriteWord(size_addr, recordstore[getStoreID(i)].getRecordSize(getRecordID(i)) - 4); } catch (RecordStoreException e) { Logger.log(e.ToString()); return(-1); } } return(i); } } return(-1); }
public static void memoryWriteWordPc(int pc, int address, int ins) { CRunTime.assertMemoryWrite("4-byte", pc, address, ins); CRunTime.memoryWriteWord(address, ins); }