Jump to content

Willsy

Members
  • Posts

    3,411
  • Joined

  • Last visited

Blog Entries posted by Willsy

  1. Willsy
    Well, I think TurboForth version 1.2 is pretty much ready for release. Just gonna let it run for a while to see if any bugs shame themselves out.
     
    Bug fixes and other improvements. I think all the *known* bugs are shaken out of it. Also some improvements to the interrupt mechanism (simplification, making it slightly faster) a fixed LEAVE (previous versions had a flaw) and some other stuff. I'm very pleased with it, but TurboForth V1.x has come to the end of the road now, I think. This will be the last release.
  2. Willsy
    A few days ago I added case insensitivity to TurboForth. When you are working on a real TI, you tend to engage the Alpha Lock key and leave the keyboard in upper case mode. However, if using via emulation then you normally have your caps lock switched off (in lower case). It always annoyed me that the system couldn't recognise load but could recognise LOAD. I mean, it's the same word!!
     
    So, I finally added the code so that it doesn't matter anymore. Basically, as text is entered from the keyboard or compiled it is converted to upper case (except stuff in strings) so it doesn't matter any more.
     
    Anway, another day, another "Hmmm" moment. I decided I would add a switch to make it selectable. So you the system can be case sensitive if you want it to be.
     
    I added a variable called CSEN. Write TRUE to CSEN, as in:
     

    TRUE CSEN !
     
    and your system is case sensitive. Write a false and it isn't. The default is false.
     
    There. Sorted!
  3. Willsy
    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.
×
×
  • Create New...