Information On The Mercury Bytecode Format

Summary of types

byte
unsigned char 0-255
cstring
Sequence of non-zero bytes terminated by zero-byte.
XXX: May change this later to allow embedded zero-bytes in strings.
short
2 bytes interpreted as signed short. It is 2's complement and big-endian. (The most significant byte is read first.)
int
4 bytes interpreted as a signed int. It is 2's complement and big-endian.
float
8 bytes interpreted as floating point value. It is IEEE-754 64-bit format and big-endian.
list of T
contiguous sequence of T
determinism
one byte interpreted as follows
tag is one of
XXX: Need explanation of all these.
cons_id (constructor id) is one of:
Note that not all of these alternatives are meaningful in all bytecodes that have arguments of type cons_id.
XXX: Specify exactly which cases are meaningful.
op_arg (argument to an operator) is one of:
dir (direction of information movement in general unification) is one of:

Summary of Bytecodes

Note: Currently we specify only the static layout of bytecodes. We also need to specify the operational semantics of the bytecodes, which can be done by specifying state transitions on the abstract machine. That is, to specify the meaning of a bytecode, we simply say how the state of the abstract machine has changed from before interpreting the bytecode to after interpreting the bytecode.


Comments? See our contact page.