Pages: 1
|
 |
|
Author
|
Topic: Ngaro: A MISC Emulator/VM (Read 3703 times)
|
Charles Childers
Administrator
Sr. Member
    
Karma: +2/-0
Offline
Posts: 745
|
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
Posts: 745
|
And here's a document detailing the instruction set.
|
|
|
|
|
Logged
|
|
|
|
Helmar
Library Contributor
Full Member
   
Karma: +1/-0
Offline
Posts: 129
TUCK what??? SWAP OVER!!!
|
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
Posts: 2
|
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
Posts: 745
|
Hi Dain,
Sounds good! I'd love to see your code.
Thanks, Charles
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: 1
|
|
|
|
|