Merge pull request #5862 from dearblue/doc/update-opcode.md

Update `opcode.md` to match the latest implementation
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-12-06 14:20:03 +09:00
committed by GitHub
+8 -4
View File
@@ -7,19 +7,23 @@ reducing the memory consumption of mruby VM.
# Instructions
Instructions are bytes. There can be 256 instructions. Currently, we
have 94 instructions. Instructions can take 0 to 3 operands.
have 106 instructions. Instructions can take 0 to 3 operands.
## operands
The size of operands can be either 8bits, 16bits or 24bits.
In the table.1 below, the second field describes the size (and
sign) of operands.
In the table.1 below, the second field describes the size
of operands.
- B: 8bit
- S: 16bit
- sS: signed 16bit
- W: 24bit
If the first and second operands are of type `B` (8bits), they may be
extended to 16bits by the operand extension instruction immediately
preceding them.
See also `OP_EXT1`, `OP_EXT2` and `OP_EXT3`.
## table.1 Instruction Table
| Instruction Name | Operand type | Semantics |