RetroForum Welcome, Guest. Please login or register.
March 11, 2010, 11:46:28 AM
Home Help Search Calendar Login Register

RetroForth Discussion  |  Main  |  Discussion  |  Topic: Ngaro: A MISC Emulator/VM « previous next »
Pages: 1 Go Down Print
Author Topic: Ngaro: A MISC Emulator/VM  (Read 3703 times)
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Ngaro: A MISC Emulator/VM
« on: January 03, 2008, 05:00:43 AM »

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.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Ngaro: A MISC Emulator/VM
« Reply #1 on: January 03, 2008, 05:02:44 AM »

And here's a document detailing the instruction set.
Logged
Helmar
Library Contributor
Full Member
****

Karma: +1/-0
Offline Offline

Posts: 129

TUCK what??? SWAP OVER!!!


View Profile
Re: Ngaro: A MISC Emulator/VM
« Reply #2 on: January 05, 2008, 10:56:56 AM »

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
Logged
Dain
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 2


View Profile
Re: Ngaro: A MISC Emulator/VM
« Reply #3 on: February 21, 2008, 10:01:43 AM »

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.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Ngaro: A MISC Emulator/VM
« Reply #4 on: February 22, 2008, 03:20:11 AM »

Hi Dain,

Sounds good! I'd love to see your code.

Thanks,
Charles
Logged
Dain
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 2


View Profile
Re: Ngaro: A MISC Emulator/VM
« Reply #5 on: February 23, 2008, 03:15:19 PM »

Sounds good! I'd love to see your code.
ok, you should have gotten my email this moment.

Ciao.
Logged
Pages: 1 Go Up Print 
RetroForth Discussion  |  Main  |  Discussion  |  Topic: Ngaro: A MISC Emulator/VM « previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Valid XHTML 1.0! Valid CSS!