Ngaro 20110929

A portable virtual machine for a dual-stack architecture
Ngaro is a portable virtual machine for a dual-stack architecture. The instruction set is essentially a subset of Forth. Though limited in its ability to interact with the underlying OS, it should be sufficient to allow a variety of programs to be written and run on it.

The package includes some basic documentation, full source code, the machine forth compiler, and a few small examples.

Usage:

./ngaro imagename

The instruction set is kept minimalistic. The exact set of instructions
changes occasionally, but the following list has been stable for about a
year. (The last three, dealing with the port-based I/O model, are new)

0 NOP Does nothing
1 LIT Push the value in the following cell to the stack
2 DUP Duplicate the top
item on the stack
3 DROP Drop the top item
on the stack
4 SWAP Exchange the top two
items on the stack
5 PUSH Push the top item on
the stack to the
address stack, drop
TOS
6 POP Pop the top item of
the address stack off
and put it on the
data stack
7 CALL Call the address that
the following literal
corresponds to
8 JUMP Jump to the address
that the following
literal corresponds
to
9 ; Return to the caller,
used with CALL
10 >JUMP Conditional jump. It
compares TOS and NOS.
11 Shift bits right
25 0; Exit (and drop) if
TOS is 0
26 1+ Increment TOS by 1
27 1- Decrement TOS by 1
28 IN Read a port
29 OUT Store to a port
30 WAIT Wait for a port-based
request to finish

If an unsupported opcode is encountered, the interal IP register is set to
the end of memory. Execution of the image code will halt when this happens.

A few instructions make use of a the following cell to contain addresses or
values. These are:

1 LIT
7 CALL
8 JUMP
10 >jump
11

last updated on:
October 3rd, 2011, 10:22 GMT
price:
FREE!
developed by:
Charles Childers
homepage:
retroforth.org
license type:
Open Software License 
category:
ROOT \ System \ Emulators

FREE!

In a hurry? Add it to your Download Basket!

user rating 22

2.9/5
 

0/5

Rate it!
What's New in This Release:
  • This version brings updated versions of all implementations and substantially updated documentation.
  • There are now 14 implementations written in Python, Ruby, Perl, Common Lisp, x86 Assembly, ANS Forth, JavaScript, Retro, Lua, Java, C, C#, F#, and Go.
read full changelog

Add your review!

SUBMIT