io_read instruction

Group: io

Additional groups: none

io_read — issue a read I/O request

Syntax

R(name) means that the operand named name must be a register address. 48 bits wide.
Ri(name) means that the operand named name must be a register index (used only by frame instruction). 40 bits wide.
V(name) means that the operand named name must be a value access. 48 bits wide.
V(name:type) means that the operand named name must be a value access evaluating to a value of type. 48 bits wide.
L(type) means that the operand must be a literal of type. Variable width, at least 8 bits.
Fn means that the operand must be a name of a function. Variable width, at least 24 bits.
Cl means that the operand must be a name of a closure. Variable width, at least 24 bits.
Ca means that the operand must be a name of a callable (function or a closure). Variable width, at least 24 bits.
Bl means that the operand must be a name of a block. Variable width, at least 16 bits.
Ma means that the operand must be an instruction marker or an instruction index (used only by jump and if instructions). 64 bits wide.
void means that the operand must be void. 8 bits wide.

  1. io_read R(result) V(:io_port) V(:limit)
  2. io_read R(result) V(:integer) V(:limit)
  3. io_read void V(:io_port) V(:limit)
  4. io_read void V(:integer) V(:limit)

samples:

Encoding

The instruction is encoded on 112 to 152 (14 to 19 bytes).

 0                   1                   2                   3  
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+---------------------------------------------------------------+
|     Opcode    |   Ot_address  |  Register_set |               |
+---------------------------------------------------------------+
|                     Index                     |   Ot_access   |
+---------------------------------------------------------------+
|  Register_set |                     Index                     |
+---------------------------------------------------------------+
|               |   Ot_access   |  Register_set |               |
+---------------------------------------------------------------+
|                     Index                     |
+-----------------------------------------------+

 0                   1                   2                   3  
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+---------------------------------------------------------------+
|     Opcode    |   Ot_address  |  Register_set |               |
+---------------------------------------------------------------+
|                     Index                     |   Ot_access   |
+---------------------------------------------------------------+
|  Register_set |                     Index                     |
+---------------------------------------------------------------+
|               |   Ot_access   |  Register_set |               |
+---------------------------------------------------------------+
|                     Index                     |
+-----------------------------------------------+

 0                   1                   2                   3  
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+---------------------------------------------------------------+
|     Opcode    |    Ot_void    |   Ot_access   |  Register_set |
+---------------------------------------------------------------+
|                             Index                             |
+---------------------------------------------------------------+
|   Ot_access   |  Register_set |             Index             |
+---------------------------------------------------------------+
|                               |
+-------------------------------+

 0                   1                   2                   3  
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+---------------------------------------------------------------+
|     Opcode    |    Ot_void    |   Ot_access   |  Register_set |
+---------------------------------------------------------------+
|                             Index                             |
+---------------------------------------------------------------+
|   Ot_access   |  Register_set |             Index             |
+---------------------------------------------------------------+
|                               |
+-------------------------------+

Viua VM | docs