forth for msx

Page 1/2
| 2

Par samsaga2

Resident (62)

Portrait de samsaga2

11-12-2009, 12:20

Hi everybody!

My last waste of time. A forth cross compiler that creates msx rom files.

Code: http://github.com/samsaga2/samforth
Code sample: http://github.com/samsaga2/samforth/blob/master/test.fs

It has a lot of limitations. For example, no immediate or find words.

!login ou Inscrivez-vous pour poster

Par Tanni

Hero (556)

Portrait de Tanni

11-12-2009, 12:42

Nice that someone still uses Forth!

Par Leo

Paragon (1236)

Portrait de Leo

11-12-2009, 14:08

Nice , thanks for sharing !
I found this forth versus C link , funny to read : http://www.inventio.co.uk/forthvsc.htm

:santa:

Par jltursan

Prophet (2619)

Portrait de jltursan

11-12-2009, 18:41

Way cool, thanks!

I own an Hector HRX and I love it's Forth implementation (Forth Pampuk).

A MSX machine with Forth instead the Microsoft BASIC interpreter would have been a cool alternative. We have Kun-BASIC in the Wavy 2+; but it's not the same...

Are there already some tests about its speed against BASIC, C or assembler?

Par RetroTechie

Paragon (1563)

Portrait de RetroTechie

12-12-2009, 00:49

Just out of curiosity: why a cross compiler? A common reason would be compilation speed, right? But AFAIK that's hardly a problem with common Forth implementations. So why not write the compiler to run on the MSX itself?

Btw. does anyone know what Forth implementations already exist, that can run on MSX (either native, or coming from CP/M land) ? Looks like a nice little language with enormous potential. But mostly it requires a different way of looking at problems, and that is what puts most people off, I suppose. Sad

Also check out ColorForth by Forth guru Chuck Moore.

Par Leo

Paragon (1236)

Portrait de Leo

12-12-2009, 11:57

well this implementation produces ROM file, so it guess you can use normal forth and make it a rom
file with this tool ?
but i guess it s a fun project .
i also got hector hrx !!!!

Par samsaga2

Resident (62)

Portrait de samsaga2

12-12-2009, 12:57

It's a cross compiler because:

- It's a fun project.
- It generates rom files.
- Already exists forth systems for MSX:
* Kuna Forth that is for MSX-DOS (impossible to found)
* CamelForth that is for CP/M (the kernel it's based on CamelForth)
- Little code overhead. It hasn't the usual word header overhead.
- No emacs for MSX ;-)

Just out of curiosity: why a cross compiler? A common reason would be compilation speed, right? But AFAIK that's hardly a problem with common Forth implementations. So why not write the compiler to run on the MSX itself?

Btw. does anyone know what Forth implementations already exist, that can run on MSX (either native, or coming from CP/M land) ? Looks like a nice little language with enormous potential. But mostly it requires a different way of looking at problems, and that is what puts most people off, I suppose. Sad

Also check out ColorForth by Forth guru Chuck Moore.

Par ARTRAG

Enlighted (6976)

Portrait de ARTRAG

12-12-2009, 22:01

so
any example to see how good is forth on msx?

Par jltursan

Prophet (2619)

Portrait de jltursan

13-12-2009, 19:04

I've compiled a windows binary of the compiler and uploaded here.

It's very easy to use, basically two steps are needed to compile a forth source (.fs):

1) samc.exe file.fs >file.asm
2) sjasm file.asm file.rom

This project originally uses sjasm assembler; but I suposse that it could be easily adapted to any other assembler out there.

Initially it has a fixed limitation of ROMs no greater than 8KB; but I guess that you can override this changing the file "samforth.end" accordingly.

There're two sample files with the project (test.fs and test2.fs). I've tested them and they work flawlessly.

Nice work! :)

Par Heca

Rookie (21)

Portrait de Heca

14-12-2009, 15:35

What is the size of the kernel when compiled?

Par Heca

Rookie (21)

Portrait de Heca

14-12-2009, 15:43

Woaa, your SYSCALL is freaking huge (slow).
Why didn't you stack all regs (to save/restore) instead ?

Page 1/2
| 2