From 8556c000935d761e38c6eebf55b855cabafc50d5 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Wed, 4 Jul 2018 00:39:48 -0400 Subject: [PATCH] Add new instructions. --- The-Dst-Abstract-Machine-Bytecode.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/The-Dst-Abstract-Machine-Bytecode.md b/The-Dst-Abstract-Machine-Bytecode.md index c848824..39b6bfd 100644 --- a/The-Dst-Abstract-Machine-Bytecode.md +++ b/The-Dst-Abstract-Machine-Bytecode.md @@ -168,7 +168,7 @@ failure to return or error. | `bnot` | `(bnot dest operand)` | $dest = ~$operand | | `bor` | `(bor dest lhs rhs)` | $dest = $lhs | $rhs | | `bxor` | `(bxor dest lhs rhs)` | $dest = $lhs ^ $rhs | -| `call` | `(call dest callee)` | $dest = call($callee) | +| `call` | `(call dest callee)` | $dest = call($callee, args) | | `clo` | `(clo dest index)` | $dest = closure(defs[$index]) | | `cmp` | `(cmp dest lhs rhs)` | $dest = dst\_compare($lhs, $rhs) | | `debug` | `(debug)` | Suspend current fiber | @@ -191,6 +191,7 @@ failure to return or error. | `jmp` | `(jmp label)` | pc = label, pc += offset | | `jmpif` | `(jmpif cond label)` | if $cond pc = label else pc++ | | `jmpno` | `(jmpno cond label)` | if $cond pc++ else pc = label | +| `len` | `(len dest ds)` | $dest = length(ds) | | `ldc` | `(ldc dest index)` | $dest = constants[index] | | `ldf` | `(ldf dest)` | $dest = false | | `ldi` | `(ldi dest integer)` | $dest = integer | @@ -202,7 +203,12 @@ failure to return or error. | `lti` | `(lti dest lhs rhs)` | $dest = $lhs \>> $rhs | | `sruim` | `(sruim dest lhs shamt)` | $dest = $lhs >>> shamt | | `sub` | `(sub dest lhs rhs)` | $dest = $lhs - $rhs | -| `tcall` | `(tcall callee)` | Return call($callee) | +| `tcall` | `(tcall callee)` | Return call($callee, args) | | `tchck` | `(tcheck slot types)` | Assert $slot does matches types |