diff options
| author | kitty <nepeta@canaglie.net> | 2026-03-16 12:22:09 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-03-16 12:22:09 +1100 |
| commit | 9ffc3b667847aee0557cc3c020f3764524f9339d (patch) | |
| tree | 9c2454d1f105dbd3319ac73047437f451de9ad5f /readme.md | |
| parent | 8b07d5b4068ec54f8f1e62d151da84c42ebf3bdd (diff) | |
`find`
Diffstat (limited to 'readme.md')
| -rw-r--r-- | readme.md | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -10,7 +10,9 @@ for amd64 linux systems. - `n`: signed integer - `u`: unsigned integer - `?`: boolean flag +- `xt`: execution token - `""`: string in input buffer +- `|`: 'or' ## Glossary @@ -43,6 +45,12 @@ marks the u bytes starting at address a as executable. this is used primarily to mark the program break, which is used as the user memory space. +### `find ( a u -- a u 0 | xt -1 )` +look in the dictionary for the word a (of u characters). +a zero is returned along with the original given string +if no word was found. if a word was found, +its xt is returned along with the true flag. + ### `grow ( u -- )` grows the user memory space by u bytes. @@ -90,3 +98,13 @@ note that the string length of one byte limits a word's name to 255 characters. ## reserved registers the register `r15` is reserved for the parameter stack pointer. + +## differences from standard forth + +for the most part this forth intends to be in line with standards +but it diverges in a few notable places: + +- the most visally obvious one by far, + this forth uses lower case word names for core words. +- `find` takes `a u` instead of a counted string, + and does not return 1 for immediate words. |
