Appendix G

Incompatibilities

Between V2.0 and V3.0

Error Handling in IFF and Picture words

Numerous changes have been made in the way that these words handle errors. IFF.WRITE? has a new stack diagram. These changes are described in detail in a special section on incompatibilities in chapter 21.

Local Variables

The local variable used in V2.0 have been completely replaced. We tried to make the new ones compatible with the old ones but there are some differences. The new locals are kept on the return stack instead of the data stack. The only code that should be affected was code that illegally used internal aspects of the old locals or that illegally relied on the parameters being on the data stack.

Between V1.2 and V2.0

The changes between JForth 1.2 and 2.0 mainly involve the addition of new code. We tried to avoid making any changes that would cause code written using version 1.2 to fail under 2.0. In some cases, however, we felt that the definition of a word in 1.2 was faulty and was worth correcting. Luckily the changes are minor.

>BODY and BODY>

In JForth 1.2, these were defined as NOOP. This was because JForth is subroutine threaded does not have a traditional CFA and PFA. We felt, however, that >BODY was mainly used to get the address of data in a CREATE DOES> word. For JForth, this meant we had to change the definition from NOOP to:

: >BODY ( cfa -- body ) DO-DOES-SIZE + ;

Please correct for this in your code if you use >BODY or BODY>.

CONSOLE

This variable contained the address of the file used for I/O by JForth V1.2. Since I/O is a two way street, Input AND Output, we actually need two separate variables. This is required to make I/O redirection work properly in Cloned programs. We, therefore, split CONSOLE into CONSOLEIN and CONSOLEOUT. The single word CONSOLE! was added that will set both of these variables. We also added CONSOLE@ for symmetry. CONSOLE@ fetches the value of CONSOLEOUT.

In JForth V1.2:

CONSOLE!

In JForth V2.0:

CONSOLE! ( one word )

Totally New Floating Point

The old floating point system was not worth keeping after we got a better version from Dave Sirag. We recommend that you switch to this new system. If you absolutely need the old system, take it off of the old disks.

Bugs Fixed

Since bugs were fixed in these words, they will behave differently. You will only have to change your code if you had made a patch for these words. There were other bugs fixed but they should not affect stack diagrams.

ROLL ( was totally messed up, now OK ) U/ ( gave wrong answers sometimes for big numbers ) D! ( used to swap halves incorrectly, not anymore )

Signed AND Unsigned Structure Members

JForth 1.2 treated all structure members as unsigned. The Amiga makes a distinction between signed and unsigned so JForth 2.0 does so as well. The difference is that if you FETCH an 8 or 16 bit signed member, it will be sign extended if it is declared as SHORT or BYTE. Members declared as USHORT or UBYTE will not be sign extended. If you store a -3 in a signed BYTE using ..! then get it back using ..! , you will have -3 on the stack. In an UNSIGNED BYTE you would end up with hex FD.

We have given you an option here. If you do not want automatic sign extension in your program, compile your code with the variable SIGNED-MEMBERS set to FALSE. The default is TRUE.




© 1998-2023 Martin Randall