[z-machine] Z-Spec 1.1 issues

Gavin Lambert uzinf at mirality.co.nz
Sat Nov 18 20:04:44 GMT 2006


At 03:49 19/11/2006, Michael S. Greger wrote:
>I did a little more checking into the issue with V1-2 encoded 
>text. I have a feeling the first rule: If the truncation to 6 
>Z-characters leaves a multi-Z-character construction incomplete, 
>the end-bit of the last word is not set.
>is indeed a bug and should not be included in the spec. In 
>addition to the problem with the dictionary order I mentioned in 
>my last post, I've discovered that typing 'get storm-' or 'get 
>nasty-' while those things are not present in the player's 
>location results in a string of garbage following the respective 
>word. This is due directly to the fact that the high bit is not 
>set on the dictionary word causing the string processing only to 
>terminate when a random word has high enough value to kill it 
>(usually taking place somewhere in the next dictionary entry). 
>This shows that each dictionary entry was meant to be a 
>self-contained string and as such should follow the rules of 
>terminating with a set high bit. Both facts together, the 
>incorrect order of the entry 'storm-' and the incorrect string 
>reading I feel is fairly strong evidence that the failure to set 
>the high bit was an error. At any rate, including this rule 
>demands the other issues be clarified. The dictionary order issue 
>can be solved with a simple rule that when the z-machine version 
>is less than 3, the dictionary is always sorted in a linear 
>fashion; however the string printing problem has no solution that 
>I can see.

I'm no Z-machine expert, but IIRC the dictionary entries are 
supposed to be completely self-contained, and have a fixed 
length.  So when you read a dictionary entry, if it's not already 
terminated you need to terminate it yourself before using 
it.  What the spec is saying is that the compiler doesn't do this 
for you, it's the interpreter's job.  (And yes, the compiler 
probably ought to, but since it historically didn't then the 
interpreters just have to cope.)


-- 
Gavin Lambert, Mirality Systems
<http://www.mirality.co.nz/>
----
Anyone who goes to a psychiatrist ought to have their head 
examined.

Few women admit their age.  Few men act theirs.




More information about the Z-machine mailing list