Forth v1.29 (Freeware)
for the Psion 3a,3c and Acorn PocketbookII

Download Forth v1.29

Back

The core of this FORTH language is written entirely in assembler for maximum speed. An OPL front end is used for simplicity. All commands entered are compiled before being executed. Any new definitions you create are compiled ready for future use.

Words defined in version 1.29 of Psion 3a Forth

forget time + - * / /mod mod . u. d. ." at cr do loop +loop if else then drop dup emit i i' j >r r> r@ over pick roll rot swap vlist 2* 2/ 2+ 2- 1+ 1- and or not xor <> 0> 0< 0= d- leave cls negate > < = <= >= sp@ s0 @ stack variable ! draw box fill d+ d* d/ beep allot seed rand

A maximum of 32 nested do..loops can be used.

A maximum of 8 if statements can be nested.

The IF statements can be used with or without the ELSE statement, but if the ELSE statement is present, it *must* be between an IF and a THEN. There are currently no checks on the state of the stack except with the . u. and d. functions. It is up to you to make sure that the stack has sufficient entries for the function used ie 'rot' requires 3 numbers on the stack but will work without. It may, however, crash the computer.

Mis-use of the language will usually give a harmless Panic 60 error, but worst case could require the psion to be reset, which could lose any unsaved data in other applications that are running.

The file 'Demo.sav' has the following words/variables defined:

  • variable count
  • variable primes 200 allot
  • init (used by go)
  • show (used by go)
  • check (used by go)
  • go works out 200 prime numbers and prints them
  • bars draws bars on screen (shows use of graphics commands)
  • 2dup (used by fact)
  • 2drop (used by fact)
  • d1- (used by fact)
  • d0= (used by fact)
  • fact (used by n!)
  • n! works out factorial of number on top of stack (upto 13)
  • primes displays prime numbers (uses variables 'primes' and 'count')
  • rnd displays 100 random sized/placed boxes on screen

Zenobyte Ltd, Highways, Les Mouriaux, Alderney GY9 3UX
Tel: 07781 496829

Registered in Alderney, CI, company number 1666