I am trying to get this switch statement to work, but I keep getting an “Uncaught SyntaxError: Unexpected string” error… I was under the impression that javascript switch statements can process strings?
swtich(opcode)
{
case "A9": loadAccImmediate(); break;
case "AD": loadAccDirect(); break;
case "8D": storeAccInMem(); break;
case "6D": addWithCarry(); break;
case "A2": loadXRegWithConst(); break;
case "AE": loadXRegFromMem(); break;
case "A0": loadYRegWithConst(); break;
case "AC": loadYRegFromMem(); break;
case "EA": noOperation(); break;
case "00": sysBreak(); break;
case "EC": compareXReg(); break;
case "D0": branchXBytes(); break;
case "EE": incByteValue(); break;
case "FF": sysCall(); break;
}
Thank you!
You misspelled
switch: