Jump to content
  • entries
    3
  • comments
    0
  • views
    15,693

TurboForth V1.2 - Still on the boil!


Willsy

1,270 views

Well, in case anyone was wondering, TurboForth V1.2 is still not ready for release. However, it's not due to apathy - the project is very very much alive.

 

The number of improvements in this release are almost too much to remember! I'll try and remember some of them:

  • Case sensitivity is now user selectable
  • The word -! (subtract and store) is superfluous and has been removed. If required for legacy code it can be defined as follows:
    : -! ( value address--) SWAP NEGATE SWAP +! ;
  • RND has been improved to produce a better sequence of random numbers. Usage remains unchanged.
  • SPRMOV has been improved so that only the sprites being moved are updated in VDP, rather than updating the sprite descriptor table for all 32 sprites regardless.
  • FOR & NEXT improved. FOR and NEXT have been re-written to use DO and +LOOP internally. I and J are available (as they were before) but additionally, it is now possible to use LEAVE to exit a FOR/NEXT loop early.
  • Case insensitivity added. Words in upper and lower case are now equivalent. This functionality can be enabled/disabled with the variable CSEN.
  • LOOP and +LOOP code merged into a single routine, improving efficiency.
  • DOCOL routine (part of the inner interpreter) improved, removing one instruction.
  • EXIT routine (part of the inner interpreter) improved, removing one instruction.
  • Return stack direction reversed. Return stack now 'grows' towards lower memory addresses. This has resulted in a further saving of one instruction in EXIT. (Exit is now a single assembly language instruction, plus a branch to NEXT).
  • Data stack and return stack buffers are now effectively merged into a single memory area (buffer). The data stack starts 'at the top' of the buffer and grows towards higher memory addresses. The return stack starts 'at the bottom' and grows towards lower memory addresses.
  • BRANCH now expects an explicit address as a parameter, rather than a relative offset, increasing the efficiency (and speed) of BRANCH. Various flow control words' internal code changed as a result (resulting in simplification).
  • 0BRANCH now expects an explicit address as a parameter, rather than a relative offset, increasing the efficiency (and speed) of 0BRANCH. Various flow control words' internal code changed as a result (resulting in simplification).
  • Stack corruption bug in JOYST fixed.
  • HEX is no longer an immediate word, in line with the Forth-83 standard.
  • DECIMAL is no longer an immediate word, in line with the Forth-83 standard.
  • ['] is now an immediate word, in line with the Forth-83 standard.
  • Nesting issue with LOAD has been fixed. It is possible to nest loading of programs/blocks as long as there is sufficient space on the return stack. From the command line, there is (currently) room on the stack to nest 6 blocks deep. Nesting of block loads is expensive, and requires 14 bytes of return stack space per nest (which is returned when the loading un-nests). The return stack is in high memory, immediately before compiled Forth code. The return stack grows towards lower memory addresses. It is therefore possible to 'crash' the return stack into the data stack (and even further beyond) if loading is nested too deeply. Note that THRU does not nest the loading of blocks (unless the blocks being loaded invoke LOAD themselves, of course).
  • Problem with BLOAD fixed when called from within a block. BLOAD failed to save/restore the current interpretation state.
  • Problem with BLOAD failing to update free memory pointers FFAILM & FFAIHM has been fixed.
  • Problem with STREAM fixed whereby it would erroneously push -1 to the stack with each invocation.
  • Problem with WHERE reporting incorrect block numbers on 1024 block block files has been corrected.
  • Bug in LEAVE fixed. LEAVE would cause a crash if invoked before a loop had executed at least once. Also greatly simplified.

Phew!

 

And I'm nowhere near finished!

 

Still many more improvements planned before release. Intermediate beta releases are released here, so keep an eye on that thread!

 

Version 1.2 is set to be a humdinger! Faster, and more efficient.

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...