



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. The patch adds code to allow compiling @je with more than two operands.
(It also includes a simple fix to the @not bug.)
About Patches
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
Solution
--- 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 2 May 2008. The librarian in charge of this page is Roger Firth. Please email any comments, suggestions or corrections to roger@firthworks.com.