Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue C62119

Negative constants in assembly
Submitted by: Daniel Schepler     Appeared in: Compiler 6.21 or before     Fixed in: Compiler 6.30
Problem

Because of a bug in parsing assembly, it's difficult to specify negative constants in assembly operations. For example, if you write

  @set_colour 4 (-1);

the compiler will tell you that it found an unexpected expression. What's really going on here is that it's misinterpreting 4(-1) as a function call. Although you could work around this by using $ffff instead of -1, that makes the code less readable.

Solution

At about line 1315 of expressp.c, change the assignment to "array_init_ambiguity" to read:

  array_init_ambiguity = ((context == ARRAY_CONTEXT) ||
  (context == ASSEMBLY_CONTEXT));


Last updated 17 April 2013. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Roger Firth.