SphereScript Object Specification
Chad Austin
2000.01.30


header (64 bytes)
  byte  signature[4]       // ".ssx"
  word  version            // 2
  word  num_labels
  dword codesize
  word  num_dependancies
  byte  reserved[50]
end header


labels[num_labels]
  word  length ' including terminating zero
  byte  label[length]
  dword offset
end labels

dependancies[num_dependancies]
  word length       ' including terminating zero
  byte name[length]
end dependancies

begin code
  dword code[codesize]
end code


The code is in the following format:

code
  dword opcode
  for each operand
    do
      dword operand_type
      dword operand
    while next-byte is reference
  end for
end code
