Talk:HSZ

From OHRRPGCE-Wiki
Jump to navigation Jump to search

NeoTA: I have a minimal script here plus it's disassembly, which may help as an intro to the workings.


define script(1, tester, 0)
script, tester, begin
      return (1024)
end

compiles to the script codes:

KIND 4, ID 0 ( LOCALVAR 0? this seems to equate to a specification of number of parameters)
KIND 2, ID 0, parameters [4,]   ( DO. I have no idea of the meaning of 4.)
KIND 2, ID 3, parameters [8,]   ( RETURN. what is the meaning of 8?)
KIND 1, ID 1024                 (the number 1024)

Can someone clarify?

TMC: I'm sorry. I started writing this months ago and never finished. I really should - it's now roughly the last piece of the format left.

The first INT is the size of the header in bytes, including the first INT. It 4 in all current HSX files.

The second INT is the number of variables (local + arguments (there is no difference))

The commands in a HSX file are a tree. Parameters are given as offsets in INTs from the start of the data (where the header ends) to the command. So the 4 is the offset to the RETURN command, and the 8 is the offset to the 'NUMBER 1024' command.