diff options
| -rw-r--r-- | jefs.fs | 0 | ||||
| -rw-r--r-- | jefs.s | 19 | ||||
| -rw-r--r-- | readme.md | 21 |
3 files changed, 38 insertions, 2 deletions
@@ -62,8 +62,25 @@ section .text global _start _start: ; init - mov r14, wstack + mov r14, wstack ; point SP to top mov rdi, 0 mov rax, __NR_exit syscall + +defword "@", fetch, 0 + pspop r11 + mov r12, qword [r11] + pspush r12 + ret + +defword "!", store, 0 + pspop r11 + pspop r12 + mov qword [r11], r12 + ret + +initfile: +incbin "jefs.fs" +initlen equ $ - initfile +initfile_end: @@ -44,7 +44,26 @@ so a wonky but hopefully not too slow solution is to compile - `mov r11, [cfa]` = `94 BB [CFA]` - `call r11` = `41 FF D3` -## Some Links +### words to bootstrap from +i want to make the kernel reasonably small, +especially if i add an assembler. +but obviously we need *something* to bootstrap from. +(this list is Inspired by [miniforth](https://github.com/meithecatte/miniforth)'s builtins) + +- `!` (`val addr -- `): store a 64 bit word +- `@` (`addr -- val`): fetch a 64 bit word +- `c!` (`byte addr -- `): store a byte +- `c@` (`addr -- byte`): fetch a byte +- `:` (` -- `): compile a word from the current input source +- `;` (` -- `): stop compiling the current word +- `parse` (` -- c-addr u`): parse a word from the *forth init* (see footnote) +- `latest`: a variable, the latest defined word +- `state`: a variable, determines current mode (interp./compiling) + +on `parse`: i don't want to deal with file access and stuff from the kernel. +so this word will be Upgraded in the forth init to read from a file. + +### Some Links - starting forth part 1: http://www.bradrodriguez.com/papers/moving1.htm - a forum thread about determining empty stack with TOS register: http://forum.6502.org/viewtopic.php?t=8424 |
