aboutsummaryrefslogtreecommitdiffgithub
diff options
context:
space:
mode:
-rw-r--r--novice/assembler/codegen/base.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/novice/assembler/codegen/base.ts b/novice/assembler/codegen/base.ts
index 7db24e3..ab64575 100644
--- a/novice/assembler/codegen/base.ts
+++ b/novice/assembler/codegen/base.ts
@@ -137,8 +137,9 @@ class BaseMachineCodeGenerator implements MachineCodeGenerator {
const [words, hasLabel] =
this.inflateInstr(isa, opSpec, subInstr, newPc,
symbtable);
- // TODO: unnecessary copy?
- allWords = allWords.concat(words);
+ for (const word of words) {
+ allWords.push(word);
+ }
}
return [allWords, false];
@@ -246,8 +247,6 @@ class BaseMachineCodeGenerator implements MachineCodeGenerator {
const minTwos = -maxUnsignedVal(numBits - 1) - 1;
if (field.kind === 'reg' && operand.kind === 'reg') {
- // TODO: support other prefixes etc
-
if (operand.num < 0) {
throw new Error(`negative register number ` +
`${operand.num} on line ${instr.line}`);