From 9797b2e25f11f5a08524815a4ca7e340ebe28939 Mon Sep 17 00:00:00 2001 From: n loewen Date: Wed, 26 Jul 2023 14:39:35 +0100 Subject: [PATCH] Rename menonic-to-machine-operation lookup table --- sketches/simulator-sketch-v2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sketches/simulator-sketch-v2.js b/sketches/simulator-sketch-v2.js index 395197d..2651a85 100644 --- a/sketches/simulator-sketch-v2.js +++ b/sketches/simulator-sketch-v2.js @@ -138,7 +138,7 @@ const Instructions = { }, } -const instructionLookupTable = { +const opcodes2mnemonics = { 0: (arg) => Instructions.end(arg), 1: (arg) => Instructions.store_lit(arg), 2: (arg) => Instructions.store_addr(arg), @@ -163,7 +163,7 @@ function stepCPU() { console.log(`OP: ${opcode} ARG: ${argument}`); - let instruction = instructionLookupTable[opcode]; + let instruction = opcodes2mnemonics[opcode]; instruction(argument); logCPUState();