}
String parts[] = cmd2.split(",");
int addr = Integer.decode("0x" + parts[0]);
int len = Integer.decode("0x" + parts[1]);
String data = "";
Memory mem = cpu.getMemory();
if (c == 'm') {
System.out.println("Returning memory from: " + addr + " len = "
+ len);
/* This might be wrong - which is the correct byte order? */
for (int i = 0; i < len; i++) {
data += Utils.hex8(mem.get(addr++, Memory.AccessMode.BYTE));
}
sendResponse(data);
} else {
System.out.println("Writing to memory at: " + addr + " len = "
+ len + " with: "
+ ((wdata.length > 1) ? wdata[1] : ""));
cPos++;
for (int i = 0; i < len; i++) {
System.out.println("Writing: " + cmdBytes[cPos] + " to "
+ addr + " cpos=" + cPos);
mem.set(addr++, cmdBytes[cPos++], Memory.AccessMode.BYTE);
}
sendResponse(OK);
}
break;
case 'C':