Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.rwth-aachen.de!news-koe1.dfn.de!news.k.shuttle.de!news.b.shuttle.de!news-ber1.dfn.de!fu-berlin.de!nntp.zit.th-darmstadt.de!news.nacamar.de!news.he.net!www.nntp.primenet.com!nntp.primenet.com!netcom.com!erkyrath
From: erkyrath@netcom.com (Andrew Plotkin)
Subject: Re: Speaking of Z8 files...
Message-ID: <erkyrathE0tGL6.A2q@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <56c1s1$apl@dfw-ixnews3.ix.netcom.com> <56ch3q$eh3@rs18.hrz.th-darmstadt.de>
Date: Wed, 13 Nov 1996 16:03:06 GMT
Lines: 46
Sender: erkyrath@netcom.netcom.com

Alexander Lehmann (lehmann@mathematik.th-darmstadt.de) wrote:
> Russell Wain Glasser <rglasser@ix.netcom.com> wrote:
> :     Out of academic curiosity, what causes a game written in Inform to
> : be saved as ".z8" rather than ".z5"?
> :     Does it depend on which version of Inform you use? 

No. There's a "version" flag in Inform, which I usually set by putting
  Switches v5;
or
  Switches v8;
at the top of my source code. That's what determines the form of the 
output. 

> : (Doubtful... I
> : used Inform 5.5 for "Reverberations," and I think that's typical; and
> : when I upgraded "Hot Cross Doubles" to Inform 6 there was no change.)
> :     Is it strictly a function of how long the code is?  (Don't think
> : so... "Curses" is much longer than "So Far", as is the short version of
> : "Jigsaw" with no footnotes; yet "So Far" is z8 and the other two are
> : z5.)

The author *chooses* a version based on how big the game file is. _So 
Far_ has a shorter plotline than _Curses_, but it has a lot more text, so 
it's over 300K. _Curses_ is under 256K.

> This has something to do with the file size due to the available
> address space.

> All Zmachine versions use 16 bit addresses. The initial Zmachine (v3)
> used 2 byte words, so that maximum file size was 128k. The v4 and v5
> machines used 4 byte words so 256k was maximum. .z8 uses 8 byte words
> and has a maximum of 512k.  

It's not actually the word size; words are always 16 bits on the 
Z-machine. It's the alignment of string and routine addresses. In v5, all 
strings and routines start at addresses that are multiples of 4. This 
allows the game to store them in 16-bit words (by dropping the two 0 
bits off the bottom) and still have a range of 256K. In v8, it's 
multiples of 8, three 0 bits, and a range of 512K.

--Z

-- 

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."
