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 web site has not been fully supported since April 2008. Information may be out of date. This page was originally managed by Roger Firth.