
VER27.TXT	29-Jan-2010

The main new feature in version 2.7 is the decrementing 'for' loop. This
uses the new command word 'downto'. What was previously kludged using
negative values can now be written in a straightforward way, for example:

 for I:= -10, -1 do    [IntOut(0,-I); CrLf(0)];	\old method
 for I:= 10 downto 1 do [IntOut(0,I); CrLf(0)];	\new method

For symmetry, a normal incrementing for loop can use the new command word
'to' in place of the comma, for example:

 for I:= 1, 10 do   [IntOut(0,I); CrLf(0)];	\existing method
 for I:= 1 to 10 do [IntOut(0,I); CrLf(0)];	\generates exact same code


There is a new shift operator that does an arithmetic shift right instead
of a logical shift right. Its symbol is "->>". An arithmetic shift can be
used to quickly divide integers by powers of 2. This works in a simple
way for positive integers, but does not give the exact same value as a
divide for negative integers. The difference is that if there is a
remainder, an integer divide truncates the quotient toward zero, whereas
the arithmetic shift right truncates the quotient toward negative
infinity. For example:

   27 / 4 = 6
   27 >> 2 = 6
   27 ->> 2 = 6
  -27 / 4 = -6
  -27 >> 2 = 16377
  -27 ->> 2 = -7
  -24 ->> 2 = -6


The interpreted version of the compiler, XPLI, supports the 'port'
command; but not the 'abs', 'rem', 'swap' or 'extend' commands. These
unsupported commands must be replaced with their equivalent intrinsic
calls.


-Loren Blaney
