You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
martin-henz edited this page Feb 26, 2020
·
21 revisions
This page serves as a repository for preliminary specification of a virtual machine code (byte code) format for Virtual Machine implementations of Source.
Assembly code format
The assembly code consists of an array of arrays. Each element array represents one instruction. Each instruction has the opcode in position 0, followed by the arguments, which might include numbers, boolean values or strings, depending on the instruction.
Bytecode format
Header:
Something similar to JVM's 0x5005ACAD
Version number: 2 bytes for minor, 2 bytes for major
Constant pool count
Constant pool
code
The code is a sequence of bytes, with segments of length 1 to 3 representing individual instructions. The first byte is the opcode, and the following bytes are the arguments.