diff options
Diffstat (limited to 'src/vm/core.js')
-rw-r--r-- | src/vm/core.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vm/core.js b/src/vm/core.js index a8fbce7..6363a60 100644 --- a/src/vm/core.js +++ b/src/vm/core.js @@ -133,6 +133,21 @@ class Core { const index = this.getLocation(pc, address); return this.data[index]; } + + + pretty(ins) { + const prettyMode = { + 'immediate': '#', + 'direct': ' ', + 'indirect': '@', + 'predecrement': '<', + }; + + return `\ +${ins.opcode} \ +${prettyMode[ins.a.mode]}${ins.a.value}, \ +${prettyMode[ins.b.mode]}${ins.b.value}`; + } } |