# sanctuary forth (working title) sanctuary forth is a 64-bit subroutine threaded forth system for amd64 linux systems. ## stack effect notation - `a`: memory address - `c`: one byte value - `n`: signed integer - `u`: unsigned integer - `?`: boolean flag ## Glossary the following is a list of words available in this forth. ### `#tib ( -- a )` variable containing the amount of characters in the input buffer. ### `>in ( -- a )` variable containing the index of the first unparsed character in the input buffer. ### `brk@ ( -- a )` yields current program break. ### `bye ( -- )` exits the forth system. ### `dp ( -- a )` a variable that contains the lowest free byte of memory in user memory. ### `dp0 ( -- )` a variable that contains the first byte of user memory. ### `dp$ ( -- )` a variable that contains the last available byte of user memory. ### `executable ( u a -- )` 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. ### `grow ( u -- )` grows the user memory space by u bytes. ### `here ( -- a )` yields the address of the first available byte in user memory. ### `latest ( -- a )` a variable containing the execution token of the most recently created word. ### `state ( -- a )` a variable containing a boolean value. if 0 (false), the system is in interpreting mode, if -1 (true), the system is in compiling mode. ### `tib ( -- a )` a variable containing the address of the current input buffer. ## dictionary format note that the string length of one byte limits a word's name to 255 characters. | field | size | | :---- | :--- | | link to previous word | 8 bytes | | flag field | 1 byte | | string length | 1 byte | | string | <256 bytes | | code | variable length | ## reserved registers the registers `r14` and `r15` are reserved for the parameter stack and the top of stack respectively.