Program
- class jam.pvm.program.Program(z: U8, jump_table: List[int], instruction_set: List[U8], offset_bitmask: List[Bit])[source]
Bases:
CodableThis is the program blob which the PVM will execute.
- Parameters:
z – Size of jump-table entries
jump_table – sequence of NN, each of size z
instruction_set – Sequence of instructions (U8)
offset_bitmask – Bitsequence of size len(instruction_set) that defines which blob is an opcode
- __init__(z: U8, jump_table: List[int], instruction_set: List[U8], offset_bitmask: List[Bit])[source]
Initialize the Codable.
- Parameters:
codec – Optional codec to use for encoding/decoding
enc_sequence – Optional function that returns sequence of fields to encode
- encode_into(buffer: bytes | bytearray, offset: int = 0) int[source]
Encode the program bytecode into a buffer.
- Parameters:
buffer – The buffer to encode the program into
offset – Offset of the buffer to start encoding from