|
4
|
Main / Discussion / Re: Ngaro: A MISC Emulator/VM
|
on: February 21, 2008, 10:01:43 AM
|
|
Started by Charles Childers | Last post by Dain
|
Hello,
The compiled code does not run easily on my 64 bit FreeBSD system cause of strange problems with the SDL library. Since in addition the performance did not fit my needs I rewrote the whole thing from scratch as a 64 bit version and change the instruction set a bit:
- two versions of the interpreter exist, of one is based on token and one on a kind of context threading, both gives a large performance boost - the cell size is now a quadword (8 byte) - added bytecodes for combined literals and stack operations, fast subroutine calls (via a new link register) and stack-less arithmetic operations for functions with two or three operands.
I plan to use this vm as a base for my own little functional language after i resolve two bugs and think my code would be of interrest for you ?
Ciao.
|
|
|
5
|
Main / Discussion / RETRO 10
|
on: January 06, 2008, 10:50:08 PM
|
|
Started by Charles Childers | Last post by Charles Childers
|
It's probably time for me to announce RETRO 10's development. I've been working on this for a few months, ever since Ngaro became stable enough to actually use.
The initial implementation is functional, though minimalistic. Since it's not being run on x86, it is a complete rewrite. I've chosen to write a custom assembler/cross-compiler which provides me with a lightweight machine forth to use. It's actually been a pleasure to work with, since the resulting language is a pretty nice subset of Forth.
You can download it from the development site at http://s3.retroforth.org/index.html. If you just want to try it, grab Ngaro (either from my previous post, or from the development site) and a copy of forth.image.
Quick Links
|
|
|
6
|
Main / Discussion / Re: Ngaro: A MISC Emulator/VM
|
on: January 05, 2008, 10:56:56 AM
|
|
Started by Charles Childers | Last post by Helmar
|
Hi crc,
nice. Instead of the two versions
>jump <jump
I would use a signed and an unsigned variant, eg.
>jump u>jump
<jump would then be a sequence "swap >jump", which should not be that bad.
Bis dann, Helmar
|
|
|
8
|
Main / Discussion / Ngaro: A MISC Emulator/VM
|
on: January 03, 2008, 05:00:43 AM
|
|
Started by Charles Childers | Last post by Charles Childers
|
Over the last few months, I've developed a new, portable virtual machine / emulator. It is built around a simulated MISC (minimal instruction set computer) processor, which is a simple 32-bit processor with about 30 instructions. Ngaro also emulates a few basic hardware devices that can be accessed via a port i/o model.
The code is written in C and makes use of SDL. I've only tested on Unix-like OSes (Linux, BeOS, BSD), but it should be pretty portable. There's an assembler, written in Toka, and a couple of examples.
In the future, I plan to release some things that will support compilation to Ngaro binary. I have written a BrainF* compiler, and am slowly working on a varient of Small-C. I'll post more on these and other projects in the near future.
|
|
|
9
|
Main / Discussion / Re: help with GP in retroforth
|
on: October 19, 2007, 12:27:51 AM
|
|
Started by clacker | Last post by lsa
|
If you use: : x1 20 ;
as a constant value. You may change it by:
: const! 5 + ! ; 50 ' x1 const!
the "5 +" advances past the "call dolit" which is compiled into the word.
The "values" solution may be cleaner, however.
|
|
|
10
|
Main / Discussion / Re: help with GP in retroforth
|
on: October 18, 2007, 03:07:56 PM
|
|
Started by clacker | Last post by Charles Childers
|
|
As a side note, can I change the value of a constant? That is probably closer to what I really want but I couldn't tell how to do that. This can be done with values (not part of the core RetroForth language, but easy enough to add):
section: variable flag expose : .value flag @ if ! flag off ;then @ ; : to flag on ; : value create 0 , as .value ; ;section
If you don't have section:, expose, or ;section, the code for them is:
loc: variable last-visible variable last-hidden : find-last-visible last repeat @ dup @ last-hidden @ =if ;then again ; here ] ( section: ) last @ last-visible ! ; here ] ( expose ) last @ last-hidden ! ; here ] ( ;section ) last-visible @ find-last-visible ! ; ;loc alias ;section alias expose alias section:
|
|
|