aboutsummaryrefslogtreecommitdiffgithub
path: root/novice/assembler/opspec/complx.ts
diff options
context:
space:
mode:
authorAustin Adams <git@austinjadams.com>2019-02-04 16:00:30 -0500
committerAustin Adams <git@austinjadams.com>2019-02-04 16:00:30 -0500
commit94c265ea9eb5fe7969efc88f5c5bc43cb4c00958 (patch)
treeeb679410a7f7ceaa54d4fa4fb4b137c980c33986 /novice/assembler/opspec/complx.ts
parent66b7b8fac57f61ecb0d259f0b25830bffdb5f6d5 (diff)
downloadnovice-94c265ea9eb5fe7969efc88f5c5bc43cb4c00958.tar.gz
novice-94c265ea9eb5fe7969efc88f5c5bc43cb4c00958.tar.xz
Codegen: do fewer painful agonizing O(n) lookups
Diffstat (limited to 'novice/assembler/opspec/complx.ts')
-rw-r--r--novice/assembler/opspec/complx.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/novice/assembler/opspec/complx.ts b/novice/assembler/opspec/complx.ts
index 85bd4bc..3b705e8 100644
--- a/novice/assembler/opspec/complx.ts
+++ b/novice/assembler/opspec/complx.ts
@@ -2,26 +2,26 @@ import { AsmContext, oneWord, OpOperands, PseudoOpSpec } from './opspec';
const complxOpSpec: PseudoOpSpec = {
ops: [
- {name: 'fill',
+ {op: 'fill',
operands: [{kind: 'int', name: 'num'}],
asm: (ctx: AsmContext, operands: OpOperands) =>
// TODO: complain if too big
[operands.ints.num & ~(-1 << ctx.isa.mem.addressability)]},
- {name: 'fill',
+ {op: 'fill',
operands: [{kind: 'label', name: 'label'}],
size: oneWord,
asm: (ctx: AsmContext, operands: OpOperands) =>
// TODO: complain if nonexistent
[ctx.symbtable[operands.labels.label]]},
- {name: 'stringz',
+ {op: 'stringz',
operands: [{kind: 'string', name: 'str'}],
asm: (ctx: AsmContext, operands: OpOperands) =>
// TODO: how is non-ascii handled? probably blow up
operands.strings.str.split('').map(c => c.charCodeAt(0)).concat([0])},
- {name: 'blkw',
+ {op: 'blkw',
operands: [{kind: 'int', name: 'count'}],
asm: (ctx: AsmContext, operands: OpOperands) => {
// TODO: needs to be randomized/uninitialized