aboutsummaryrefslogtreecommitdiff
path: root/README
blob: 81948dc638d1b52dc58b42b48db85403690165a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
minimal, slow as fuck, and simple to expand forth dialect

2^16 bytes memory (@ store, ! access)
unsigned 16-bit bytes
supports unsigned int literal
supports signed int literal
supports unsigned fixed point literal
supports signed fixed point literal
supports string literal (array of bytes)

: ( switch to compile )
; ( switch out of compile )
@ ( a b -- )
! ( a -- b )
+ ( a b -- c )
< ( a b -- c )
. ( a -- )

implementation of usually built-in features

: dup 0 @ 0 ! 0 ! ; ( a -- a a )
: drop 0 @ ; ( a -- )
: swap 0 @ 1 @ 1 ! 0 ! ; ( a b -- b a )
: neg 32768 + ; ( a -- b )
: - neg + ; ( a b -- c )
: not 1 swap - ; ( a -- b )
: = - not ; ( a b -- c )

yes, i'm an idiot