Skip to content

Buffer Manipulation Opcodes ​

This section documents the buffers instructions available in CandleVM.

For operand encodings, see the executable format reference.

Buffers ​

Opcode byteOpcodeOperand bytesBehavior
64NewBufferdestination: register, size: registerConverts size from byte or non-negative finite integer number to usize, allocates a zero-filled Buffer of that size and stores its ObjectRef value.
65BufferLendestination: register, buffer: registerStores the byte count as a numeric value (Byte for lengths 0–255, otherwise Number).
66BufferGetdestination: register, buffer: register, index: registerReads one byte at the index and stores it as a Byte; out of range raises BufferIndexOutOfBounds.
67BufferSetbuffer: register, index: register, value: registerWrites a byte at the index. Value accepts a byte or an integral finite number in 0..255; out of range raises BufferIndexOutOfBounds.

Built for the Candle ecosystem · Powered by VitePress.