forked from rdebath/whitespace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
command-list.txt
66 lines (52 loc) · 1.57 KB
/
command-list.txt
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
The number of permutations of three characters is 27, we have 24 instructions
so there should be no need for more than three. However, we are tending to
avoid linefeeds and we want to use the 'ss' short code.
ss N push Push
sts N N-pick Ref *** 0 pick == dup, like forth
stl N leave Slide ***
sls dup Dup as forth
slt swap Swap as forth
sll drop Discard as forth
tsss add Plus as forth
tsst sub Minus as forth
tssl mul Times as forth
tsts div Divide as forth
tstt mod Modulo as forth
tts store Store swaped relative to forth
ttt fetch Retrieve as forth
tlss outc OutputChar as forth emit
tlst outn OutputNum
tlts readc ReadChar reads into memory like forth "expect" but only one char at a time.
tltt readn ReadNum
lss L label Label
lst L call Call
lsl L jmp Jump
lts L jz If-Zero
ltt L jn If-Negative
ltl ret Return
lll quit End
// *** These two added later -- V0.3
// "N-pick (Copy/Ref) is just like Forth (excpet it uses a constant);
// "N-slide" is a limited substitute for ROT.
// The "N" must be positive so only valid forms are "stls" and "stss"
// some suggestions...
// stts pick
// sttt roll
// sttl depth
// These codes make the language Turing complete without "fetch" and "store".
//
// ssl (N -- R) 'R' is a random value between 0 and N-1 inclusive
// ssl (N 0 -- ) Init the pseudo random number generator with N
// Zero means an unknown external source which MAY be
// just a clock.
// Unused prefixes. (ssl may be a zero)
ssl
stt
tstl
tsl
ttl
tlsl
tltl
tll
lls
llt