diff options
| author | kitty <nepeta@canaglie.net> | 2026-02-15 13:12:05 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-02-15 13:12:05 +1100 |
| commit | 1e8811261e7b7a58ff4269c9b4ef16fbcc49e3d4 (patch) | |
| tree | cd461ae43008b806e387cebf27e25cbc0b66cf3b | |
| parent | b362a30a6c1dfe81f70d86b843d58068a99bc867 (diff) | |
emit, cr, sp
| -rw-r--r-- | jefs.fs | 7 | ||||
| -rw-r--r-- | jefs.s | 6 | ||||
| -rw-r--r-- | readme.md | 3 |
3 files changed, 13 insertions, 3 deletions
@@ -6,10 +6,13 @@ : if 0branch here @ 0 d, ; immediate ( I: -- a ) : then dup here @ swap - 4 - swap d! ; immediate +: cells 8 * ; +: cell+ 8 + ; : / /mod swap drop ; : mod /mod drop ; : syswrite ( u c-addr fd -- n ) 1 syscall3 ; : say ( c-addr u -- ) swap 1 syswrite drop ; -: saying 0 if bye then ; -saying TESTSTR say bye +: emit ( chr -- ) sp cell+ 1 swap 1 syswrite 2drop ; +: cr 10 emit ; +TESTSTR say cr bye @@ -153,6 +153,12 @@ defword "c,", c_comma, 0 mov qword [here], r12 ret +; note: this puts the _address it itself pushes_ on the stack +; maybe this is not the correct approach? +defword "sp", _sp, 0 + pspush r14 + ret + ; stage 1 parser. very rudimentary, ; since it will only parse a little bit of the init file ; there won't be much error checking either. @@ -1,7 +1,8 @@ # jewelforth -its a subroutine threaded forth for linux x86\_64. +it's a subroutine threaded forth for linux x86\_64. mostly made for personal stuff. +it does not conform to any standards, i just implement what i want. if you use it and it breaks, too bad public domain |
