Words - ZefTheFox/OC-Forth-Interpreter GitHub Wiki

The version of Forth this interpreter is modeled after is Redpower's.

Here are a list of the words this version includes and how to use them. Capitalization is important.

  • WORDS - Dynamically displays a list of all current words.
  • . - Outputs the top item of the stack to the terminal and removes the top item from the stack.
  • + - Performs addition between the top 2 items of the stack
  • : - Define a new word, put the name of the new word after it like below. After the name you may start typing additional words to define a function of sorts. You may use multiple lines, to finish defining the word use a semicolon (;).
    • : EXAMPLE
  • EXIT - Closes the forth interpreter and resumes OpenOS
  • IGNORECAPS - Configures the ignoring caps feature of this forth interpreter based off the top number of the stack. (1 = true, 0 or anything else = false.)
  • HOE - Short for halt on error, configures halting execution of words if there is an error based off the top number of the stack.
  • PAGE - Clears the screen
  • IOXINIT - Defines a redstone card, only needed once
  • IOXSET - Set the redstone output on a side (the second to top number of the stack), to a signal strength (top number of the stack)
  • DUP - Duplicate the top number of the stack.
  • .S - Displays the full stack without manipulating it.
  • .* - Displays a following string to the terminal, used as below. (Asterisk is a replacement for quotes as though quotes wouldn't work)
    • .* Hello World!*