Commit 321d7cce authored by George Hotz's avatar George Hotz

minor fixes

parent 2f5f2e1f
...@@ -38,7 +38,7 @@ contract MIPS { ...@@ -38,7 +38,7 @@ contract MIPS {
} }
function WriteMemory(bytes32 stateHash, uint32 addr, uint32 value) internal returns (bytes32) { function WriteMemory(bytes32 stateHash, uint32 addr, uint32 value) internal returns (bytes32) {
if (m != MIPSMemory(0)) { if (address(m) != address(0)) {
return m.WriteMemory(stateHash, addr, value); return m.WriteMemory(stateHash, addr, value);
} else { } else {
assembly { assembly {
...@@ -50,7 +50,7 @@ contract MIPS { ...@@ -50,7 +50,7 @@ contract MIPS {
} }
function ReadMemory(bytes32 stateHash, uint32 addr) internal view returns (uint32 ret) { function ReadMemory(bytes32 stateHash, uint32 addr) internal view returns (uint32 ret) {
if (m != MIPSMemory(0)) { if (address(m) != address(0)) {
ret = m.ReadMemory(stateHash, addr); ret = m.ReadMemory(stateHash, addr);
} else { } else {
assembly { assembly {
...@@ -200,8 +200,8 @@ contract MIPS { ...@@ -200,8 +200,8 @@ contract MIPS {
} }
if (shouldBranch) { if (shouldBranch) {
uint32 val = pc + 4 + (SE(insn&0xFFFF, 16)<<2); return branchDelay(stateHash, nextPC,
return branchDelay(stateHash, nextPC, val, false); pc + 4 + (SE(insn&0xFFFF, 16)<<2), false);
} else { } else {
// branch not taken // branch not taken
return branchDelay(stateHash, nextPC, nextPC+4, false); return branchDelay(stateHash, nextPC, nextPC+4, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment