planckforth/README.md

26 lines
901 B
Markdown
Raw Normal View History

2020-12-28 14:11:20 +01:00
# PlanckForth: Bootstrapping Forth from Handwritten Binary
```
$ make
```
2020-12-28 18:16:46 +01:00
2020-12-29 06:51:27 +01:00
```
$ cat helloworld.fs | ./plank
```
2020-12-28 18:16:46 +01:00
# Builtin Words
2020-12-29 06:41:03 +01:00
| code | name | semantics |
|:----:|:--------:|:-----------------------------------------:|
| Q | quit | ( -- ) Exit the process |
| C | cell | ( -- n ) The size of Cells |
| h | here | ( -- addr ) The address of 'here' cell |
| l | latest | ( -- addr ) The address of 'latest' cell |
| k | key | ( -- n ) Read character |
| t | type | ( n -- ) Print character |
| j | jump | ( -- ) Unconditional branch. |
| J | 0jump | ( a -- ) Jump if a == 0. |
2020-12-29 06:49:42 +01:00
| f | find | ( c -- xt ) Get execution token of c |
| x | execute | ( xt -- ... ) Run the execution token |