From d0259b21becfa366bde486f90112b83d3ba6ec09 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 7 Mar 2019 17:28:52 +0200 Subject: tmp --- spec/ability.fspec | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'spec') diff --git a/spec/ability.fspec b/spec/ability.fspec index 5a695a0..fa1281b 100644 --- a/spec/ability.fspec +++ b/spec/ability.fspec @@ -42,30 +42,16 @@ struct dat { // PUSH | 0x02 | Pushes `v` to the stack. // PUSHR | 0x03 | Pushes the contents of register `r?` to the stack. // POP [v] | 0x04 | Pops `v` into register `r?`. -// INCR | 0x05 | Increments the register `r?` by one. -// OP [...] | 0x06 | Performs operation specified by the `op`, and pushes the result to the stack. -// QUEUE (...) | 0x07 | Queues next `len` bytes for execution for the next `IO` instruction. +// OP [...] | 0x05 | Performs operation specified by the `op`, and pushes the result to the stack. +// QUEUE (...) | 0x06 | Queues next `len` bytes for execution for the next `IO` instruction. // * * The code is executed before or after `IO` instruction, depending whether VM is packing or unpacking. -// IO (...) | 0x08 | Unpacking: Reads data from external VM input (usually a file) to register pointed by `r1`. -// * * Packing: Writes data to external VM output (usually a file) from register pointed by `r1`. +// IO [r?] (...) | 0x07 | Unpacking: Reads data from external VM input (usually a file) to register `r?`. +// * * Packing: Writes data to external VM output (usually a file) from register `r?`. // * * `sz` is the size of the element in bits. // * * Rest of the stack is the number of elements, if empty, the elements to read/write is 1. -// EXEC [r??] (...) | 0x09 | Sets `r1` to `r??` and executes instructions stored in register `r?`. -// * * Rest of the stack is the number of times to execute, if empty, execution happens only once. -// * * `r1` will be saved and restored during this instruction. -// CALL (...) | 0x0A | Calls a function. The name of the function is stored in register `r?`. -// JMP | 0x0B | Jumps to the `off` (in bytes). -// JMPIF [v] | 0x0C | Performs `JMP`, if `v` is true. -// STRUCT [r??] | 0x0D | Describes register `r?` as struct structure. register `r??` contains the name of the struct. -// SELECT | 0x0E | Describes register `r?` as select structure. -// FIELD (...) | 0x0F | Links field to last structure. register `r?` contains the name of the field. -// * * Rest of the stack contains register indices for registers that are instances of this field. -// BSZ [sz] | 0x10 | Describes last field as a primitive field. `s` describes whether the field is signed. `v` describes how the -// * * field should be represented. `sz` contains the size of field in bits. -// REF | 0x11 | Describes field as a substructure. register `r?` contains the structure definition. -// FDIMENSION | 0x12 | Adds fixed dimension to a field. `sz` indicates the size of the dimension. -// VDIMENSION | 0x13 | Adds variable length dimension to a field. -// ENUM | 0x14 | Links field to a enum +// CALL (...) | 0x08 | Calls a function. The name of the function is stored in register `r?`. +// JMP | 0x09 | Jumps to the `off` (in bytes). +// JMPIF [v] | 0x0A | Performs `JMP`, if `v` is true. // // List of operations for the `OP` instruction: // Name | Hex | Argc | Description @@ -91,7 +77,7 @@ struct dat { // CTERNARY | 0x13 | 3 | Conditional ternary operation `v1 ? v2 : v3` // SUBSCRIPT | 0x14 | 2 | Subscript operation `v1[v2]` // -// List of visuals for the `PIO` instruction: +// List of visuals: // Name | Hex | Representation // NUL | 0x00 | None // DEC | 0x01 | Decimal -- cgit v1.2.3