Jump to content
IGNORED

fbForth—TI Forth with File-based Block I/O [Post #1 UPDATED: 06/09/2023]


Lee Stewart

Recommended Posts

 

Frankly, the only way to fully test a language is by creating a complete project with it. Not only are obscure bugs frequently teased out, but it's also an opportunity to add enhancements as well.

 

True that.

 

 

The great thing about you and Willsy is that you are incredibly responsive and available, so fixes are done very quickly, sometimes within hours! Thank you guys :)

 

As I said once before, I have far more discretionary time than you and @Willsy. It helps, too, that I enjoy it immensely. As to @Willsy, he is just a coding maniac with Forth and ALC and does not need as much time as it seems to take me. He must be much better organized.

 

In fixing those last two bugs, I managed to tighten up some repetitive code that gained me 38 more bytes in Bank 1—so, now we have:

 

Bytes

Bank Left

---- -----

0 16

1 82 :-o

2 54

3 30

 

...lee

  • Like 1
Link to comment
Share on other sites

In fixing those last two bugs, I managed to tighten up some repetitive code that gained me 38 more bytes in Bank 1—so, now we have:

 

Bytes

Bank Left

---- -----

0 16

1 82 :-o

2 54

3 30

 

...lee

 

He he!!! You're now entering "optimisation hell" where you will spend the next two to three years finding ways to optimise your existing code in order to fit more code into it!

 

Welcome to my world! It's been lonely around here, glad to have some company :P

 

You know that old saying "This broom has been in our family for generations, it's had 4 new brushes and 3 new handles!" - that's TurboForth. Some of the code has been written, then re-written, then re-written again as new ideas occur to me. It's a bit like an addiction, you can't put it down. And I'm *still* fiddling with the bloody thing, though I've finally admitted defeat and am moving to a larger cartridge space! Though 276 words in the built-in dictionary is pretty cool for a 16K cart ;-)

  • Like 1
Link to comment
Share on other sites

If you never want to retire from fiddling with the language, an interesting future might be to have a facility to load blocks from more pages in the cart rom. With an auto load if present, situation. Something that would enable deployment of a forth app/game as a cart itself.

 

Just a thought as it sounds like both forths would need some significant change if they got any bigger. Maybe that change could make them extensible as well as bigger.

 

-M@

Link to comment
Share on other sites

If you never want to retire from fiddling with the language, an interesting future might be to have a facility to load blocks from more pages in the cart rom. With an auto load if present, situation. Something that would enable deployment of a forth app/game as a cart itself.

 

Just a thought as it sounds like both forths would need some significant change if they got any bigger. Maybe that change could make them extensible as well as bigger.

 

-M@

 

Well—fbForth, moved up to 64KiB ROM, would certainly enable many extra loading possibilities. I am not sure autoload is a relevant term when you must choose something to run, unless you would distinguish between choosing an application and choosing to run it as two operations versus choosing the application to run it as one operation.

 

The space problem with fbForth in its current state would be partially mitigated with the extra space going from 32KiB to 64KiB. I say “partially” because the major problem is that Bank 0 must currently contain the parameter and code fields of every word in the resident dictionary. Right now, there are only 12 bytes free in Bank 0! I can certainly move parts of many words to other banks, particularly those coded in ALC. There are many words in the resident dictionary that are in high-level Forth code, as well. Those words could be re-coded in ALC and the bulk of their code moved to other banks; but, that is certainly a lot of work.

 

Additionally, the header for every word in the resident dictionary must currently reside in Bank 2. The space left in Bank 2 is only 54 bytes; but, I could easily free up an additional 1194 bytes by moving screen-font stuff to another, new bank.

 

My current scheme for locating the bank and address of the body code for resident words could, I believe, accommodate another bit to manage eight banks before I would need to contrive another, clever scheme. |:)

 

fbForth currently has 200 more words in its resident dictionary than does TurboForth. This is actually a bit unwieldy for the interpreter. I should probably figure out a way to start fbForth without all of the extra words, particularly, the floating point, file I/O and graphics libraries, which were optional in TI Forth. Then, I would need another scheme for linking those libraries to the dictionary.

 

The last problem I see is the number of labels in my ALC. I am right up against the limit for Asm994a, which is undocumented but around 2866. I will be forced to try another assembler with any more ALC additions. Perhaps, this is a good time for me to explore @ralphb's xas99 assembler.

 

...lee

Link to comment
Share on other sites

Post #1 is updated with the latest binary build (fbForth 2.0:3) for Classic99, real iron (fbForth200_20151026.zip) and MESS (fbForth200_MESS_20151026.zip). The latest FBLOCKS file and two font files are included in FIAD format and in two disk images (90KiB and 400KiB) in each of the foregoing ZIP files as well as in a separate file (FBLOCKS_20151026.zip).

 

Let me know if anything is missing or broken.

 

Anyone who wants to burn their own 32KiB EPROM (27C256) can do so with the file, fbForth200_3.bin, contained in the first ZIP file referenced above. It is set up for boards with the 379-latch chip wired in inverted mode (Jon Guidry boards and Jim Fetzner black boards).

 

Anyone who bought a cartridge from me can send me their EPROM and I will send it back by prepaid USPS First Class Mail with the new binary. If you are coming to the Chicago Faire, I can exchange (if I have any loose chips) or erase/rewrite EPROMs there.

 

...lee

Link to comment
Share on other sites

Look at the form factor for the available chips on your data sheet, Omega. You have two choices there: PLCC and TSOP. Neither of those can be used on a Guidry board or on a Black board, as those require DIP chips. The same would go for Red boards and Yellow boards, as those are also configured for DIP use. Note that you could probably build your own adapter to use the 29-series chips on the boards, but you would not be able to program them in-system, as the bank switching circuitry will step all over that process, based on Tursi's recent deep-dive into that possibility with the UberGROM boards.

Link to comment
Share on other sites

Like Jim said, it must be a DIP-28 form factor. Given that, as long as the relevant pinouts are the same and it cannot be accidentally flashed in situ, it should work. ABRA Electronics says they have them for ~$8 apiece. I am pretty sure Atmel no longer fabricates them, however.

 

...lee

Link to comment
Share on other sites

Like Jim said, it must be a DIP-28 form factor. Given that, as long as the relevant pinouts are the same and it cannot be accidentally flashed in situ, it should work. ABRA Electronics says they have them for ~$8 apiece. I am pretty sure Atmel no longer fabricates them, however.

 

...lee

 

Yeah, I knew I saw them somewhere.... << ACTUALLY IT'S HERE >> :) They are $6.03 a piece with shipping tacked on.

 

med_gallery_35324_1027_9751.jpg

Link to comment
Share on other sites

I found an earlier version of the datasheet you were looking at--it included the DIP part. The difference between the two chips is pin 1. On the 27C256 it is VPP and on the 29C256 it is WE. Normally VPP is tied low to prevent writing to the chip, and so is WE, so they should work fine--although they are significantly more expensive than the 27 series EPROMs. I've been getting used 27C256 chips for about 75 cents each (although there will be some bad chips in that mix, so the real price is closer to $1.10), or $1.75 each as NOS.

Link to comment
Share on other sites

...although they are significantly more expensive than the 27 series EPROMs.

 

It appears so! I was just thinking from an easy to update aspect. If an EEPROM was used, anyone with a burner could just pop out the chip erase and re-flash the new version and pop it back it. I don't know how many people even have or use UV erasers anymore.

Link to comment
Share on other sites

I spent most of my childhood waiting for the computer to load something, format something, download something, or list something :) I figured I can be patient enough to erase something with a little light. Anyone use one of these?: http://www.ebay.com/itm/301718071627

 

I ordered it special for handling these fbForth updates... :) I've heard it referred to as 'scary', but I don't think it will get here in time for Halloween. Some reviewer called them scary asserting that it looked like it would burn your house down.

Link to comment
Share on other sites

I spent most of my childhood waiting for the computer to load something, format something, download something, or list something :) I figured I can be patient enough to erase something with a little light. Anyone use one of these?: http://www.ebay.com/itm/301718071627

 

I ordered it special for handling these fbForth updates... :) I've heard it referred to as 'scary', but I don't think it will get here in time for Halloween. Some reviewer called them scary asserting that it looked like it would burn your house down.

 

That is what I use. It works quite well enough. I usually set the mechanical timer-switch between ‘2’ and ‘3’ (20 and 30 minutes). The actual time required can vary because you may not get the quartz windows of all chips placed directly below the most intense part of the UV light—inverse-square law operating here.

 

...lee

  • Like 1
Link to comment
Share on other sites

That is what I use. It works quite well enough. I usually set the mechanical timer-switch between ‘2’ and ‘3’ (20 and 30 minutes). The actual time required can vary because you may not get the quartz windows of all chips placed directly below the most intense part of the UV light—inverse-square law operating here.

 

...lee

The eraser did work quite well, just as you said! The fbForth cartridge you made for me is all upgraded now :) And my code still worked. I have taken out the workarounds, and all my issues were fixed.

 

Thanks!

-M@

  • Like 1
Link to comment
Share on other sites

hey matt,

 

check out the ustream.tv broadcast of Lee doing a fbForth/Turboforth comparison (from yesterday at the TI Faire)

 

http://www.ustream.tv/recorded/76712901

 

 

Yes, that was good stuff! I've been curious about that particular subject of comparison between these two Forths for a while.

 

I enjoyed the discussion on floored division vs. 'symmetric' division. That could turn into a real astonishing difference. I was not previously aware of the significance of that. I found this paper on division:

http://research.microsoft.com/pubs/151917/divmodnote-letter.pdf

 

There was a brief story of porting between TurboForth and fbForth, with the suggestion that the right thing to do is redefine the words, instead of rewriting the app that is being ported. I think this was treated once in this thread already, but as language features go, that is a pretty powerful aspect of Forth. Compilation binds to the definitions available at that time, and they stick. So the system stays coherent, even if you redefine something as integral as EMIT or CR.

 

It seems to me that variables are also in the same definition stack, so they can be overridden as well with the same protections... Is that correct? I'll have to go do some learning :)

 

Definitely good stuff!

  • Like 1
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...