Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue C62108

@je should accept upto four operands
Submitted by: Daniel Schepler     Appeared in: Compiler 6.21 or before     Fixed in: Compiler 6.30
Problem

According to the Z-Machine specification, @je can take anywhere from one to four operands (one being useless since it never branches). However, the Inform assembler does not accept any more operands than two.

Solution

The patch adds code to allow compiling @je with more than two operands. (It also includes a simple fix to the @not bug.)

  --- asm.c~      Wed Apr 28 13:14:08 1999
  +++ asm.c       Wed Oct 10 15:19:33 2001
  @@ -328,7 +328,7 @@
   /* 0 */ { (uchar *) "not",     4, 4,  3, 0x0F,  St,  0, 0, ONE },
   /* 1 */ { (uchar *) "save",    4, 4,  4, 0x05,  St,  0, 0,ZERO },
   /* 2 */ { (uchar *) "restore", 4, 4,  5, 0x06,  St,  0, 0,ZERO },
  -/* 3 */ { (uchar *) "not",     5, 0, -1, 0x38,   0,  0, 0, VAR },
  +/* 3 */ { (uchar *) "not",     5, 0, -1, 0x38,  St,  0, 0, VAR },
   /* 4 */ { (uchar *) "save",    5, 0, -1, 0x00,  St,  0, 0, EXT },
   /* 5 */ { (uchar *) "restore", 5, 0, -1, 0x01,  St,  0, 0, EXT },
   /* 6 */ { (uchar *) "pull",    6, 6, -1, 0x29,  St,  0, 0, VAR }
  @@ -1597,6 +1597,9 @@
                  /* Exception for the V6 set_colour, which can take
                     a third argument, thus forcing it into VAR form: */
                  if ((version_number == 6) && (O.code == 0x1b)) max = 3;
  +              /* Also an exception for je, which can take from 1
  +                 argument (useless) to 4 arguments */
  +              if (O.code == 0x01) { min = 1; max = 4; }
                  break;
   case VAR:      min = 0; max = 4; break;
   case VAR_LONG: min = 0; max = 8; break;


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.