[z-machine] Z-Spec 1.1 issues

Michael S. Greger mgreger at cinci.rr.com
Sun Nov 19 01:14:25 GMT 2006


Thanks for the reply.

Yes the dictionary entries are a fixed length, but here's what happens
when you type 'get storm-' in a location where that object doesn't
exist: after a successful lookup in the dictionary of the word 'storm-'
the game uses that address as an operand to the print_addr opcode.
Print_addr knows nothing about dictionary entries, it only understands
printing strings. In order for an interpreter to cope with dictionary
entries like this ALL string printing will have to do something like
this:  
-----------------------------------------
What is the start of the dictionary?
How many entries are there?
Does the address in the operand fall within the dictionary?
If so, what is the encoding length? (this is different from the entry
size)
Print a string that is only as long as the encoding length.
Otherwise print the string normally.
-----------------------------------------

This seems a rather silly requirement for an opcode which has nothing to
do with the dictionary. Yes I suppose it is possible to do, but it is
ugly in the extreme. My guess is the original Infocom interpreters
either a) failed to recognize these words entirely, or b) they printed
garbage after the word as I discovered below. Considering these issues I
think it reasonable to assume this was a bug unless someone with access
to the original V1-2 interpreters can prove otherwise (both that the
word is recognized and that it can be printed correctly). Note that
using the word in the presence of the relevant object does not print the
dictionary entry. It prints the object description instead, which is a
completely different string. The command must be used in the absence of
the object to test the printing of the dictionary entry.

Thanks,
MikeG


-----Original Message-----
From: Gavin Lambert [mailto:uzinf at mirality.co.nz] 
Sent: Saturday, November 18, 2006 3:05 PM
To: Michael S. Greger; z-machine at feelies.org
Subject: Re: [z-machine] Z-Spec 1.1 issues


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