Forth Cheat Sheet                                 -*- mode: org; -*-

* 2011/6/9 restart

** Input/output
.s . 

** Arithmetic
+ - * / mod negate 
/mod ( n m -- nMODm n/m )

** Stack juggling
drop ( x -- ) 
dup ( x -- x x )
over ( x y -- x y x )
swap ( x y -- y x )
rot ( x y z -- y z x )
nip ( x y -- y )
tuck ( x y -- y x y )

** Operator type prefixes
u: unsigned integer
c: character
d: signed double-cell integer
ud, du: unsigned double-cell integer
2: two cells
m, um: mixed single- and double-cell operations
f: floating point

* Original sheet

Arithmetic :: + - * / mod negate /mod 1+ 1-

Logical/bitwise :: and or xor invert 2/

Comparison :: = <> < > <= >=

Comparison prefix :: 0 u d d0 du f f0

General prefix :: u c d ud du 2 m um f

Parameter :: n u c f a-addr a- c-addr c- xt w,x d ud r

Stack :: .s . drop dup over swap rot 2swap 2drop nip tuck

Conditional :: if...then if...else...then

Loop :: begin...again begin...while...repeat begin...until

Miscellaneous :: assert( see words