lab17: part 4
This commit is contained in:
@@ -18,6 +18,15 @@ let opcodes = {
|
||||
let v2 = vm.stack.pop();
|
||||
vm.stack.push(v1-v2);
|
||||
}},
|
||||
0x52: { mnemonic: 'MLOAD', evaluate: (vm) => {
|
||||
let offset = vm.stack.pop();
|
||||
vm.stack.push(vm.memory[offset]);
|
||||
}},
|
||||
0x53: { mnemonic: 'MSTORE', evaluate: (vm) => {
|
||||
let offset = vm.stack.pop();
|
||||
let value = vm.stack.pop();
|
||||
vm.memory[offset] = value;
|
||||
}},
|
||||
0x5B: { mnemonic: 'JUMPDEST', evaluate: (vm) => {
|
||||
// Does nothing. We could check to make sure that jumps
|
||||
// always land at JUMPDEST opcodes, but it is not totally
|
||||
|
||||
Reference in New Issue
Block a user