aboutsummaryrefslogtreecommitdiffgithub
path: root/novice/assembler/opspec
diff options
context:
space:
mode:
Diffstat (limited to 'novice/assembler/opspec')
-rw-r--r--novice/assembler/opspec/complx.ts8
-rw-r--r--novice/assembler/opspec/opspec.ts2
-rw-r--r--novice/assembler/opspec/word.ts4
3 files changed, 7 insertions, 7 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
diff --git a/novice/assembler/opspec/opspec.ts b/novice/assembler/opspec/opspec.ts
index 58dce93..d1f3923 100644
--- a/novice/assembler/opspec/opspec.ts
+++ b/novice/assembler/opspec/opspec.ts
@@ -17,7 +17,7 @@ interface OpOperands {
}
interface OpSpec {
- name: string;
+ op: string;
operands: OpOperandSpec[];
asm: (ctx: AsmContext, operands: OpOperands) => number[];
size?: (isa: Isa) => number;
diff --git a/novice/assembler/opspec/word.ts b/novice/assembler/opspec/word.ts
index 4125045..d9866ff 100644
--- a/novice/assembler/opspec/word.ts
+++ b/novice/assembler/opspec/word.ts
@@ -3,13 +3,13 @@ import { AsmContext, oneWord, OpOperands, PseudoOpSpec } from './opspec';
const wordOpSpec: PseudoOpSpec = {
ops: [
- {name: 'word',
+ {op: 'word',
operands: [{kind: 'int', name: 'num'}],
asm: (ctx: AsmContext, operands: OpOperands) =>
// TODO: complain if too big
[maskTo(operands.ints.num, ctx.isa.mem.addressability)]},
- {name: 'word',
+ {op: 'word',
operands: [{kind: 'label', name: 'label'}],
size: oneWord,
asm: (ctx: AsmContext, operands: OpOperands) =>