[Inform 6] What dictionary flags does the Inform compiler use?

I found this documentation of the dictionary flags in the technical manual:

However, as I examine the dictionary of a game file, I find that some words (all verbs maybe?) have bit 6 set. Is there more up to date documentation on the compiler? Can someone tell me what flags are used nowadays?

1 Like

Even the code doesn’t know what that flag is for…

2 Likes

It appears in the Inform 6.12 library (parser.h) as DICT_X654.

Constant DICT_VERB $01;
Constant DICT_META $02;
Constant DICT_PLUR $04;
Constant DICT_PREP $08;
Constant DICT_X654 $70;
Constant DICT_NOUN $80;

if (indef_mode ~= 0)
  dict_flags_of_noun = DICT_X654;  ! Reject "plural" bit

This usage (setting bit 6 for verbs) goes back at least to Inform 5. It might have been relevant to an even older version of the library (Inform 1-4), but it’s not needed by the I5 or I6 library.

This is because if that bit is set, then the verb number (dict_par2) is also set, so you can just look at that.

It appears in the Inform 6.12 library (parser.h) as DICT_X654.

That line of code removes all but bits 6, 5, and 4. But the following code only cares about bit 3, so it’s another leftover complication which no longer matters.

2 Likes

with this layout (i find it often in really old asm code and formats), the two most frequent cases are easily checked via l/r rotating thru carry and branching on carry, but the acorn Archimedes (the machine on which Inform was developed) used a 32 bit RISC microprocessor (the ARM 1), so is an interesting detail…

Best regards from Italy,
dott. Piergiorgio.

Another trick is to check the topmost flag with a compare instruction. Even on a 32-bit machine, you can easily check if a number is >= 128.

Acorn architecture isn’t relevant. These fields are for use on the Z-machine, which has no “rotate through carry” or “branch on carry” instructions. Inform games always use the @and opcode to extract one bit.

Or @test, I presume. But you are right, Acorn was a red herring here.

Nope, always @and. Inform 6 does not generate the @test opcode unless you explicitly write it in assembly, and the I6 library never does that.

oops. wrong perspective. I was thinking compiler-side instead of library/source-side. My apologies.

(I got inform 5.4 DOS in a bundle with all doc and raif/rgif faqs from a shareware CD, circa 1995, was my very first contact with this very community… Back then, I have a very highly optimised 386sx/20, I tried 8086 inform only once, then stick to inform 386… hence my high Respect to the Archimedes and ARM 1)

Best regards from Italy,
dott. Piergiorgio.

1 Like