OldComp.cz

Komunitní diskuzní fórum pro fanoušky historických počítačů


Právě je 28.03.2024, 11:00

Všechny časy jsou v UTC + 1 hodina [ Letní čas ]




Odeslat nové téma Odpovědět na téma  [ Příspěvků: 3 ] 
Autor Zpráva
 Předmět příspěvku: PORT: FORTH pre Megadrive
PříspěvekNapsal: 04.09.2014, 12:36 
Aby programatori neostali naprazdno tak prinasam linku
na programovaci jazyk FORTH.

SCREENSHOT:
Obrázek

DOWNLOAD:
https://github.com/ehaliewicz/megaforth

SOURCE:
https://github.com/ehaliewicz/megaforth ... /forth.bin

OVLADANIE:
Controls (6-button isn't required but definitely helps):
A - Set character at cursor to A
B - Delete character in front of cursor
C - Insert space at cursor
X - show possible words based on prefix starting where the cursor is pointing (shows one suggestion per button press)
Y - enable on-screen keyboard
Z - hold to allow left-right movement in keyboard mode.
Mode - Starts or completes word definitions by inserting ";" or ":" based on state. This is done on a line-by-line basis, it doesn't keep track of the state of the interpreter. Don't use with multi-line definitions.
Start - send line to interpreter

Features:
- Basic forth dictionary (stack manipulation, arithmetic, memory manipulation, basic text i/o)
- Subroutine-threaded compiler (compiles words as lists of JSRs to other words)
- C interop via CCALL0/1/2/3 words, binary includes SGDK libraries. Push args in left-to-right order with the function's address last. C function addresses have to be hardcoded, it has no way of discovering them at runtime.
- Supports compiling included forth text at start up.


Currently known issues:
- Probably several word-related bugs. Expect division related words to fail.
- "." (general number printing) is buggy for larger numbers.
- Weird issue with deleting and inserting near the beginning of input line.
- Prefix suggestions overwrite rather than insert text
- Clearing keyboard on hardware doesn't work

Future Ideas (in order of likeliness to implement):
- Fix bugs
- Implement more compiler words (for IF/ELSE, variables, etc.)
- Implement optimizer (for inlining short words, compiling BSRs rather than JSRs, tail-call optimization, etc)
- Some way of calling arbitrary C routines at runtime? We'd need to keep track of a symbol table, I guess.
- Task switching for lightweight cooperative multitasking
- Some way to develop on PCs and send code over serial to compile
- Cool logo on startup
- Open to other suggestions


Nahoru
  
 
 Předmět příspěvku: Re: PORT: FORTH pre Megadrive
PříspěvekNapsal: 04.09.2014, 16:43 
Offline
Site Admin
Uživatelský avatar

Registrován: 11.05.2013, 23:48
Příspěvky: 10111
Bydliště: Praha
Has thanked: 1953 times
Been thanked: 1517 times
Toto je MEGA masochismus :-)

_________________
Amiga/Amstrad/Atari/Commodore/Mac/Nintendo/PS/PC/Sega/Tandy/ZX


Nahoru
 Profil  
 
 Předmět příspěvku: Re: PORT: FORTH pre Megadrive
PříspěvekNapsal: 04.09.2014, 17:35 
Ale kdezeby FORTH ma ineho adepta na sadomaso...
AVR FORTH COMPUTER
Obrázek
Takze gamepad je este luxus...


Nahoru
  
 
Zobrazit příspěvky za předchozí:  Seřadit podle  
Odeslat nové téma Odpovědět na téma  [ Příspěvků: 3 ] 

Všechny časy jsou v UTC + 1 hodina [ Letní čas ]


Kdo je online

Uživatelé procházející toto fórum: Žádní registrovaní uživatelé a 5 návštevníků


Nemůžete zakládat nová témata v tomto fóru
Nemůžete odpovídat v tomto fóru
Nemůžete upravovat své příspěvky v tomto fóru
Nemůžete mazat své příspěvky v tomto fóru
Nemůžete přikládat soubory v tomto fóru

Hledat:
Přejít na:  
Založeno na phpBB® Forum Software © phpBB Group
Český překlad – phpBB.cz