ENCYCLOPEDIA 4U .com



Encyclopedia Home Page

Google
  Web Encyclopedia4u.com

 

Forth virtual machine

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

  • nest, also called docol
  • unnest, or semi_s (;s)
  • next

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:
  • DTC (Direct Threaded Code)
  • STC (Subroutine Threaded Code)
  • TTC (Token Threaded Code)

less often used are
  • return threading
  • string threading
  • call threading




Content on this web site is provided for informational purposes only. We accept no responsibility for any loss, injury or inconvenience sustained by any person resulting from information published on this site. We encourage you to verify any critical information with the relevant authorities.



Copyright © 2005 Par Web Solutions All Rights reserved.
| Privacy

This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Forth virtual machine".