diff --git a/assembler.js b/assembler.js index de50abe..be49a6c 100644 --- a/assembler.js +++ b/assembler.js @@ -86,7 +86,8 @@ function decodeInstructions(line) { // Handle constant definitions if (opName.startsWith('=')) { // TODO: validate constant - let constantName = opName.substring(1); // strip '>' + // FIXME - a quick hack to get around problems caused by another use of lower-casing to sanitize input: + let constantName = opName.substring(1).toLowerCase(); // strip '>' let constantValue = arg_str; constants[constantName] = constantValue; dbg(2, `constants:`); @@ -125,7 +126,8 @@ function decodeInstructions(line) { // Handle references to constants } else if (arg_str.startsWith('=')) { - arg_str = arg_str.substring(1) // strip '>' + // FIXME - a quick hack to get around problems caused by another use of lower-casing to sanitize input: + arg_str = arg_str.substring(1).toLowerCase(); // strip '>' dbg(2, `operand references '${arg_str}'`); arg_str = constants[arg_str]; dbg(2, `arg_str from '${arg_str}`);