diff --git a/simulator.js b/simulator.js index bf80c9a..7b2c646 100644 --- a/simulator.js +++ b/simulator.js @@ -10,9 +10,14 @@ const CPU = { Acc: 0, memory: null, loadMemory: (data) => { // data: Uint8Array - // TODO: check length of data + if (data.length > 256) { throw new Error("Out of memory error (program too long)"); } CPU.memory = data; }, + currentInstruction: { + opcode: null, + argument: null, + mnemonic: null, + } }