diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | Makefile | 14 | ||||
| -rw-r--r-- | readme.md | 18 | ||||
| -rw-r--r-- | sanctuary.s | 13 |
4 files changed, 47 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d9ff4c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +sanctuary +sanctuary.o diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e1a04a7 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +TARGET := sanctuary +SRCS = sanctuary.s + +all: $(TARGET) + +$(TARGET): $(TARGET).o + ld -N -static -o $@ $< + +$(TARGET).o: $(SRCS) + nasm -g -F dwarf -f elf64 -o $@ $< + +.PHONY: clean +clean: + -rm -f $(TARGET) $(TARGET).o @@ -2,3 +2,21 @@ 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. (neither of these have been implemented yet i'm just putting them here in the meantime lol) + +### `dp ( -- a )` +`dp` is a variable that contains the lowest free byte of memory in user memory. + +### `here ( -- a )` +`here` yields the address of the first available byte +in user memory. diff --git a/sanctuary.s b/sanctuary.s new file mode 100644 index 0000000..ad8720f --- /dev/null +++ b/sanctuary.s @@ -0,0 +1,13 @@ +; sanctuary + +section .bss + +resq 4091 +wstk: resq 1 + +section .text +global _start +_start: + mov rdi, 0 + mov rax, 60 + syscall |
