diff options
| author | kitty <nepeta@canaglie.net> | 2026-03-20 01:03:51 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-03-20 01:03:51 +1100 |
| commit | a654a2e0418b0f143cb4d6c55776c844e7254e22 (patch) | |
| tree | 6116fe042b689df325c36c475dba8c74eb904d44 /readme.md | |
| parent | ae2bb07e11ce6582cc9c7d45d1b8137c355e9db7 (diff) | |
stack and math words
Diffstat (limited to 'readme.md')
| -rw-r--r-- | readme.md | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -17,6 +17,9 @@ sanctuary is a 64-bit subroutine threaded forth for amd64 linux systems. the following is a list of words available in this forth. +### `! ( u a -- )` +store the 64 bit value u into the memory address a. + ### `#tib ( -- a )` variable containing the amount of characters in the input buffer. @@ -35,9 +38,18 @@ remainder is in n3, result is in n4 ### `+ ( u1 u2 -- u )` add u2 to u1. +### `+! ( a -- )` +add one to the value at memory address a. + +### `, ( u -- )` +write a 64 bit value to user memory and increment the user memory pointer. + ### `- ( u1 u2 -- u )` subtract u2 from u1. +### `-! ( a -- )` +subtract one from the value at memory address a. + ### `-rot ( u1 u2 u3 -- u3 u1 u2 )` rotate the three topmost values on the stack so that the topmost value is moved to the third highest. @@ -57,6 +69,9 @@ start compilation of the word 'name'. ### `; ( -- ) IMMEDIATE` end compilation of the currently compiling word. +### `@ ( a -- u )` +fetch the 64 bit value at memory address a. + ### `>body ( xt -- a )` yield the code field of xt. @@ -67,6 +82,12 @@ in the input buffer. ### `>r ( u -- ) ( R: -- u )` move a value from the working stack to the return stack. +### `1+ ( u -- u')` +add one to u. + +### `1- ( u -- u')` +subtract one from u. + ### `2drop ( u1 u2 -- )` remove the two topmost values from the stack. @@ -82,6 +103,23 @@ yields current program break. ### `bye ( -- )` exits the forth system. +### `c, ( c -- )` +write an 8 bit value to user memory and increment the user memory pointer. + +### `c! ( u a -- )` +store the 8 bit value u into the memory address a. + +### `c@ ( a -- c )` +fetch the 8 bit value at memory address a. + +### `cmove ( a1 a2 u -- )` +copy u bytes of memory from a1 to a2. +bytes are copied in low memory to high memory order. + +### `cmove> ( a1 a2 u -- )` +copy u bytes of memory from a1 to a2. +bytes are copied in high memory to low memory order. + ### `dp ( -- a )` a variable that contains the lowest free byte of memory in user memory. |
