# Lua Programming Language ## Lua 5.4 C API ## Lua 5.4 Bytecode > [!note] > These are **unstable** and may differ in different versions of the language. > They are not part of the language specification but an implementation detail, which in this case is the reference implementation. > [!note] > The reference implementation used to have a stack based but now uses a register based VM similar to how modern real computer architectures. The instructions are 32 bits wide; every instruction has an opcode that takes up 7 bits, which leaves out 25 bits for the addresses and values. The instructions work with three register referred to as: A, B, C; each are of length 8 bits.
31 | ... | 24 | 23 | ... | 16 | 15 | 14 | ... | 7 | 6 | ... | 0 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
iABC | C (8 bits) | B (8 bits) | k (1 bit) | A (8 bits) | OP (7 bits) | ||||||||
iABx | B (17 bits) | A (8 bits) | OP (7 bits) | ||||||||||
iAsBx | signed B 17 bits) | A (8 bits) | OP (7 bits) | ||||||||||
iAx | Ax (25 bits) | OP (7 bits) | |||||||||||
sJ | signed jump address (25 bits) | OP (7 bits) |