mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
Fix stack notation
This commit is contained in:
parent
9a8257c238
commit
8c59b2fd67
1 changed files with 34 additions and 34 deletions
68
README.md
68
README.md
|
@ -9,37 +9,37 @@ $ cat helloworld.fs | ./planck
|
|||
|
||||
# Builtin Words
|
||||
|
||||
| code | name | stack effect | 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 | ( -- c ) | Read character |
|
||||
| t | type | ( c -- ) | Print character |
|
||||
| j | jump | ( -- ) | Unconditional branch |
|
||||
| J | 0jump | ( a -- ) | Jump if a == 0 |
|
||||
| f | find | ( c -- xt ) | Get execution token of c |
|
||||
| x | execute | ( xt -- ... ) | Run the execution token |
|
||||
| @ | fetch | ( addr -- a ) | Load value from addr |
|
||||
| ! | store | ( a addr -- ) | Store value to addr |
|
||||
| ? | cfetch | ( addr -- c ) | Load byte from addr |
|
||||
| $ | cstore | ( c addr -- ) | Store byte to addr |
|
||||
| d | dfetch | ( -- addr ) | Get data stack pointer |
|
||||
| D | dstore | ( addr -- ) | Set data stack pointer |
|
||||
| r | rfetch | ( -- addr ) | Get return stack pointer |
|
||||
| R | rstore | ( addr -- ) | Set return stack pointer |
|
||||
| i | docol | ( -- addr ) | Get the interpreter function |
|
||||
| e | exit | ( -- ) | Exit current function |
|
||||
| L | lit | ( -- a ) | Load immediate |
|
||||
| S | string | ( -- addr len) | Load string literal |
|
||||
| + | add | ( a b -- c ) | c = (a + b) |
|
||||
| - | sub | ( a b -- c ) | c = (a - b) |
|
||||
| * | mul | ( a b -- c ) | c = (a * b) |
|
||||
| / | div | ( a b -- c ) | c = (a / b) |
|
||||
| % | mod | ( a b -- c ) | c = (a % b) |
|
||||
| & | and | ( a b -- c ) | c = (a & b) |
|
||||
| \| | or | ( a b -- c ) | c = (a \| b) |
|
||||
| ^ | xor | ( a b -- c ) | c = (a ^ b) |
|
||||
| < | less | ( a b -- c ) | c = (a < b) |
|
||||
| = | equal | ( a b -- c ) | c = (a == b) |
|
||||
| code | name | stack effect | semantics |
|
||||
|:----:|:---------|:----------------|:-----------------------------|
|
||||
| Q | quit | ( -- ) | Exit the process |
|
||||
| C | cell | ( -- n ) | The size of Cells |
|
||||
| h | &here | ( -- c-addr ) | The address of 'here' cell |
|
||||
| l | &latest | ( -- c-addr ) | The address of 'latest' cell |
|
||||
| k | key | ( -- c ) | Read character |
|
||||
| t | type | ( c -- ) | Print character |
|
||||
| j | jump | ( -- ) | Unconditional branch |
|
||||
| J | 0jump | ( n -- ) | Jump if a == 0 |
|
||||
| f | find | ( c -- xt ) | Get execution token of c |
|
||||
| x | execute | ( xt -- ... ) | Run the execution token |
|
||||
| @ | fetch | ( a-addr -- w ) | Load value from addr |
|
||||
| ! | store | ( w a-addr -- ) | Store value to addr |
|
||||
| ? | cfetch | ( c-addr -- c ) | Load byte from addr |
|
||||
| $ | cstore | ( c c-addr -- ) | Store byte to addr |
|
||||
| d | dfetch | ( -- a-addr ) | Get data stack pointer |
|
||||
| D | dstore | ( a-addr -- ) | Set data stack pointer |
|
||||
| r | rfetch | ( -- a-addr ) | Get return stack pointer |
|
||||
| R | rstore | ( a-addr -- ) | Set return stack pointer |
|
||||
| i | docol | ( -- a-addr ) | Get the interpreter function |
|
||||
| e | exit | ( -- ) | Exit current function |
|
||||
| L | lit | ( -- a ) | Load immediate |
|
||||
| S | string | ( -- c-addr u ) | Load string literal |
|
||||
| + | add | ( a b -- c ) | c = (a + b) |
|
||||
| - | sub | ( a b -- c ) | c = (a - b) |
|
||||
| * | mul | ( a b -- c ) | c = (a * b) |
|
||||
| / | div | ( a b -- c ) | c = (a / b) |
|
||||
| % | mod | ( a b -- c ) | c = (a % b) |
|
||||
| & | and | ( a b -- c ) | c = (a & b) |
|
||||
| \| | or | ( a b -- c ) | c = (a \| b) |
|
||||
| ^ | xor | ( a b -- c ) | c = (a ^ b) |
|
||||
| < | less | ( a b -- c ) | c = (a < b) |
|
||||
| = | equal | ( a b -- c ) | c = (a == b) |
|
||||
|
|
Loading…
Reference in a new issue