Jump to content
IGNORED

TurboForth V1.2.1 released


Willsy

Recommended Posts

Finally I've managed to get TurboForth V1.2.1 released. The EPROM files, and a classic99 file are available on the TurboForth website downloads page, along with the accompanying BLOCKS disk, and an additional TFTOOLS disk.

 

In terms of getting EPROMS for cartridges you can download the EPROM image from the website yourself for burning, or 'yall in the USA/Canada should contact Bob Carmany, AKA @atrax27407 and he can burn them for you.

 

I'm looking for volunteers in Europe to burn chips for those that want a chip and don't have a burner. It will be a while before I'm in a position to make up any carts for European users.

 

The big change in V1.2.1 is that it's compatible with the nanoPEB and its variants (I think it always worked with the CF7).

 

Here's a summary of the changes:

 

Change List

Working OK Confirmation

Change Description

Status

Comment

Internal start-up code

N/A

The code to start the system (in both bank 0 and bank 1) has been simplified and reduced in size.

WORD improved

RFT

Word has been improved. The maximum size of a word that WORD can parse is 80 characters. Previously, a larger word would cause the stacks to be overwritten. Now, WORD gives up at 80 characters and reports a length of 80 characters.

['] improved

RFT

['] now aborts with an error if the word to be ticked cannot be found.

' improved

RFT

' now aborts with an error if the word to be ticked cannot be found.

TO improved

RFT

TO now aborts with an error if the target of TO cannot be found. Note however, no check is performed to check that the target word is a child of VALUE.

+TO improved

RFT

+TO now aborts with an error if the target of +TO cannot be found. Note however, no check is performed to check that the target word is a child of VALUE.

Error reporting improved

RFT

If an error is found while loading a block, the line on which the error is detected is reported.

Fix List

Confirmation

Problem Description

Status

Comment

Confirmed by

Storage of block numbers in word header fields

RFT

A bug associated with the storage of block numbers in the header fields of words has been fixed (bug in HEADER fixed). When words are loaded from blocks, their block number is also stored in the header of the word. This allows the location of the word to be quickly found using WHERE. An issue in HEADER caused the wrong value to be stored. This is now fixed.

MARKER words not updating memory pointers

RFT

Child words of MARKER were not calling ALIGN to force the update of the low and high memory pointers. This has now been fixed.

Nano PEB compatibility issue

RFT

An issue with VDP RAM allocation which prevented the Nano PEB from working with TurboForth V1.2 has been fixed in V1.2.1.

New Features

Tested

Feature Description

Status

Comment

Confirmed by

CELL+ added

RFT

The ANS94 word CELL+ has been added. CELL+ is simply a synonym (in TurboForth) for 2+.

CHAR+ added

RFT

The ANS94 word CHAR+ has been added. CHAR+ is simply a synonym (in TurboForth) for 1+.

  • Like 3
Link to comment
Share on other sites

  • 3 weeks later...

Despite owning a number of micros in the past with FORTH packages I've never really bothered trying to write programs but having burned TF 1.2.1 to an EPROM, I thought I'd give this a go.

 

Apart from some very basic DO LOOP tests, I've not really gone too deep but as an extension to my DO/LOOP initiation, I thought I'd have a try at printing a loop of squared numbers.

: TEST 100 0 DO I DUP * . LOOP ;

Works fine but at one stage [and being a beginner] I omitted the "I" index like so:

: TEST 100 0 DO DUP * . LOOP ;

This causes an underflow error (understandable, I suppose) but TF doesn't recover gracefully.

 

When the cursor returns, TF appears to have forgotten everything it knows. COLD does nothing and my TEST program no longer operates, requiring a power-cycle to recover.

 

Is this expected behaviour?

 

It's hard to make programs idiot-proof. Idiots can be so ingenious.

(This one certainly was!)

Edited by UKRetrogamer
Link to comment
Share on other sites

...

: TEST 100 0 I DUP * . LOOP ;

Works fine (??!!) ...

 

Hooboy! You really stepped in it. First off, you forgot the DO ! It should be

: TEST 100 0 DO I DUP * . LOOP ;

Actually, I'm surprised either one of those definitions compiled without the DO—they shouldn't have. Mark will have to weigh in on that.

 

Regarding graceful failure in Forth—Forth pretty much does what you tell it to do. There are many errors it gracefully handles, but for some things, you just have to walk through the code. Like I said, your code should have failed to compile with an appropriate message; but, you need to know that I does not know it is reading a loop’s index, it is merely reading what is on the return stack because the top of the return stack has the current value of a DO loop’s index for a properly constructed DO ... LOOP .

 

...lee

Link to comment
Share on other sites

 

Hooboy! You really stepped in it. First off, you forgot the DO ! It should be

: TEST 100 0 DO I DUP * . LOOP ;

Actually, I'm surprised either one of those definitions compiled without the DO—they shouldn't have. Mark will have to weigh in on that.

 

I told you, I'm an idiot. I *DID* originally enter the loop including the DO on the Ti-99/4a but omitted to copy it into the code snippet above. I'll go back and edit it to read as it was on the real hardware.
Edit: My original response to Lee was typed in a rush. Apologies if I sounded a little terse.
I was more puzzled by why FORTH effectively became unresponsive/broken after running my erroneous code.
I wonder if a Jupiter Cantab Ace would die in a similar fashion after running the same code?
Mind you, I lost count back in the day, the number of times I lost code to an unrecoverable hang or errant reset while learning Z80 assembler on my microdrive-equipped 48K ZX Spectrum due to code-errors; so I guess this type of problem isn't unique to FORTH, huh?
Edited by UKRetrogamer
Link to comment
Share on other sites

TF will catch "un - balanced" loops st compile-time (loop without do if without then etc).

 

You caused a humongous stack underflow condition. However TF does not check for stack underflow as your code runs - it would slow things down too much.

 

As your code executes the address of the top of the stack is moving upwards (towards lower memory addresses). Unfortunately you have a DUP in there which is writing to the stack. At some point you are going to write cr*p into the memory addtess that points to the end of the dictionary (called LATEST). When that happens TF can't find the dictionary any more so anything you type will be 'not found'

 

It's happened to me a million times ;-)

 

In Forth you are fully in control of the computer. There's really nothing between you and the CPU. Consequently you're free to screw up any way you want :-)

Link to comment
Share on other sites

  • 4 months later...

Please pardon me if I'm asking a stupid question, but ...

 

... I've burned the concatenated EPROM images onto a 27128 and inserted it into a HexBus v03c cartridge board (74LS379, jumpered at JP1 and JP3).

 

Although I can see both versions of TurboForth at the selection screen, choosing either results in a blue screen and unresponsive machine.

 

Is there a known issue with TurboForth and this board? Obviously others have working cartridges ... which PCB is being used, and where can I get one?

 

Edit: Never mind. It turns out that the 680-ohm resistor at R1 is *not* optional. Funny how one tends to figure out the problem soon after asking publicly for help ...

Edited by ckoba
Link to comment
Share on other sites

And that resistor is 68 Ohms. . .not 680. It will definitely make a difference (having built hundreds of the various cartridge boards, I'm used to a lot of the possible failure modes). The 1 nano Farad capacitor is also really value sensitive. . .whereas the 22 pico Farad can be replaced with a .1 micro Farad to add more stability.

Link to comment
Share on other sites

And that resistor is 68 Ohms. . .not 680. It will definitely make a difference (having built hundreds of the various cartridge boards, I'm used to a lot of the possible failure modes). The 1 nano Farad capacitor is also really value sensitive. . .whereas the 22 pico Farad can be replaced with a .1 micro Farad to add more stability.

 

Yes, 68 ohm, my mistake in writing the post (even though I was looking at the board while I was writing it). Yesterday was a long day.

Link to comment
Share on other sites

Hmm interesting. Is it being used as a current limiting resistor? I'm wondering why it's necessary at all. Just curious.

 

I was wondering the same thing. The WE signal might be noisy; the resistor, in conjunction with that 1nf cap, could be smoothing out the signal (and eliminating the need for another IC). It would be interesting to see if switching to a HCT-family flip-flop would eliminate the need for the resistor/cap combo.

Link to comment
Share on other sites

Welcome to the world of Forth icon_biggrinwink.gif

 

There's lots of information on the TurboForth website to get you going. Like what is Forth, and various tutorials to get you started.

 

Have fun. Post here if you get stuck. icon_thumbsup.gif

 

Thanks for that. I'm waiting for a nanoPEB to arrive; once I have something that emulates disks, I'll dive into TurboForth :)

 

(aside: is there any reliable source for nanoPEB other than Stargames? Ultimately I'd like to be able to build/repair my own, but I haven't found any design docs or FPGA programming image ...)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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...