Commit 9a9763f8 authored by 0xrin1's avatar 0xrin1 Committed by norswap

MIPS.sol else statements

parent a1f635f6
......@@ -46,26 +46,24 @@ contract MIPS {
bytes32 newStateHash = m.WriteMemory(stateHash, addr, value);
require(m.ReadMemory(newStateHash, addr) == value, "memory readback check failed");
return newStateHash;
} else {
}
assembly {
// TODO: this is actually doing an SLOAD first
sstore(addr, value)
}
return stateHash;
}
}
function ReadMemory(bytes32 stateHash, uint32 addr) internal returns (uint32 ret) {
if (address(m) != address(0)) {
emit TryReadMemory(addr);
ret = m.ReadMemory(stateHash, addr);
//emit DidReadMemory(addr, ret);
} else {
}
assembly {
ret := sload(addr)
}
}
}
function Steps(bytes32 stateHash, uint count) public returns (bytes32) {
for (uint i = 0; i < count; i++) {
......@@ -191,13 +189,11 @@ contract MIPS {
if (shouldBranch) {
return stepPC(stateHash, nextPC,
pc + 4 + (SE(insn&0xFFFF, 16)<<2));
} else {
}
// branch not taken
return stepPC(stateHash, nextPC, nextPC+4);
}
}
// memory fetch (all I-type)
// we do the load for stores also
uint32 mem;
......
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