Main Page | See live article | Alphabetical index

Forth virtual machine

Often, Forth implementations have a simple virtual machine at heart, consisting of three primitives. Those are:

three registers are used to implement the virtual machine, another one exists for passing data between words, which use the vm. These are: different models exist to implement the forth vm, the one given here implements indirect threaded code, or ITC
next:   (ip)+ ->   w    ;  jmp (w)+
nest:    ip   -> -(rp)  ;  w -> ip  ;  next
unnest: (rp)+ ->   ip   ;  next

other models are: less often used are