diff options
| author | kitty <nepeta@canaglie.net> | 2026-03-08 18:02:01 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-03-08 18:02:01 +1100 |
| commit | 5f70edcd2c717209bfd0095e3f698851b4ec447e (patch) | |
| tree | 114de7eca70e15548112501f2ff7c16ca5ed9acc | |
| parent | d0444e62cbae194f6b331e9030cedcfc83b79da4 (diff) | |
remove old unused stuff, move todo to end
| -rw-r--r-- | jefs.s | 129 | ||||
| -rw-r--r-- | readme.md | 24 |
2 files changed, 10 insertions, 143 deletions
@@ -677,83 +677,6 @@ defword "lit", lit, immediate_mask ; C: ( n -- ) ( -- n ) mov qword [here], r12 ret -; what to compile: -; ADDR ← IP + 16 -; JMP AFTER_STRING -; S c, T c, R c, ... -; [ fill AFTER_STRING ] -; PUSH ADDR -; PUSH CNT -defword "litstring", litstring, immediate_mask ; I: ( delim -- ) - pspop r11 ; delim - mov r12, [here] - mov r13, qword [to_in] - add r13, qword [tib] - - mov byte [r12], 0xe9 ; JMP - inc r12 - push r12 ; place to write to later (32bit) - mov dword [r12], 0x00000000 ; filler value - add r12, 4 - - xor r10, r10 ; count -.loop: - mov r15b, byte [r13] - - cmp r15b, r11b - je .done - - mov byte [r12], r15b - - inc r10 ; count - inc r12 ; here - inc r13 ; >in - jmp .loop - -.done: - ; put back r13, we're done reading from tib - inc r13 - sub r13, qword [tib] - mov qword [to_in], r13 - - ; repurpose r13 as reljmp write location - pop r13 - inc r10 ; jump strlen + 1 bytes forward - mov dword [r13], r10d - dec r10 - - add r13, 4 ; r13 + 4 = string location - - ; copied from LIT (which consumes r12) - ; we copy it here because then we keep using - ; theh same r12 as we were before - ; bit long but i think it's Fine - ; i'm not rlly worried about code size - mov dword [r12], 0xf8768d4d - add r12, 4 - mov word [r12], 0xbb49 - add r12, 2 - mov qword [r12], r13 ; addr - add r12, 8 - mov word [r12], 0x894d - add r12, 2 - mov byte [r12], 0x1e - inc r12 - - mov dword [r12], 0xf8768d4d - add r12, 4 - mov word [r12], 0xbb49 - add r12, 2 - mov qword [r12], r10 ; slen - add r12, 8 - mov word [r12], 0x894d - add r12, 2 - mov byte [r12], 0x1e - inc r12 - - mov qword [here], r12 - ret - defword "syscall0", syscall0, 0 ; ( id -- rax ) pspop rax syscall @@ -1158,58 +1081,6 @@ defword ">s0", to_s0, 0 mov r14, wstack ret -; ; TEMPORARY HORRIBLE DEBUGGING BULLSHIT {{{ -; ; debugging word; outputs raw bytes so needs to be piped through `x(x)d` -; ; terrible and awful -; ; W = r14; W <= wstack_b; W+=8 -; defword ".s", dots, 0 -; push r11 -; push r12 -; -; mov r12, r14 -; .loop: -; cmp r12, wstack -; jge .done -; -; mov [.space], r12 -; mov rdx, 8 ; qword -; mov rsi, .space -; mov rdi, 1 -; mov rax, __NR_write -; syscall -; -; mov rdx, 8 ; qword -; mov rsi, r12 -; mov rdi, 1 -; mov rax, __NR_write -; syscall -; lea r12, [r12+8] -; jmp .loop -; -; .done: -; mov rdx, 16 ; 2 qword -; mov rsi, .dmsg -; mov rdi, 1 -; mov rax, __NR_write -; syscall -; -; pop r12 -; pop r11 -; ret -; .space: resq 1 -; .dmsg: db "DONEDONEYIPPEEEE" -; -; defword "HEREDUMP", heredump, 0 -; mov rdx, [here] -; mov r11, [herestart] -; sub rdx, r11 -; mov rsi, [herestart] -; mov rdi, 1 -; mov rax, __NR_write -; syscall -; ret -; ; }}} - ; maybe some of these should be constants? defvar "tib", tib, 0, initfile defvar "#tib", num_tib, 0, initlen @@ -7,20 +7,6 @@ if you use it and it breaks, too bad public domain -## TODO -i want to get to Version 1 soon, here are some things -i am thinking of completing before that. - -- `s\"` -- `DO` + `LOOP` -- `<BUILDS` and `DOES>` -- reading from files -- argc + argv -- testing -- documentation - -not all of these will be included. we'll see - ## dictionary the dictionary follows a fairly standard format. @@ -39,6 +25,7 @@ this does not follow any standards. here are some things to keep in mind - the string output word is called `say` instead of `type` (i may change this) - `create` can't be used for arrays and stuff. use `make` instead - `:noname` is called `:>` (based on duskos). it also just creates a word called `_` and pushes its xt to the stack +- an `include` discards the rest of the input line ## the one reserved register @@ -69,3 +56,12 @@ the error codes are: - 3: compilation only - 4: interpret only - 5: includes too recursed + +## TODO + +- argc + argv +- testing +- `s\"` +- `DO` + `LOOP` +- `<BUILDS` and `DOES>` +- better documentation? |
