diff options
| author | kitty <nepeta@canaglie.net> | 2026-02-13 14:26:37 +1100 |
|---|---|---|
| committer | kitty <nepeta@canaglie.net> | 2026-02-13 14:26:37 +1100 |
| commit | d99cd40d4c8f513e46e94ec553011f65866c071c (patch) | |
| tree | 794fa47c702e5306380e4c7910ace964435ae315 | |
| parent | 7ff7495fc0574207b88987438f17105aa8b7df95 (diff) | |
move HERE to .bss proper
i don't know how to mark the heap as executable.
im not entirely sure it's possible.
we can't increase its size with this
but it Works.
compiling mode still doesn't work though...
the code in `test` runs in interpreting mode.
| -rw-r--r-- | jefs.fs | 4 | ||||
| -rw-r--r-- | jefs.s | 44 |
2 files changed, 27 insertions, 21 deletions
@@ -1 +1,3 @@ -bye +: test parse bye find drop >cfa compile, ; +HEREDUMP +test @@ -60,28 +60,32 @@ %assign __NR_exit 60 ;; }}} -section .bss +section .bss exec wstack_b: resq 2047 wstack: resq 1 +umem: resb 0x9c400 +umem_e: + section .text global _start _start: + ; mov r11, 0x0409040904090409 ; init mov r14, wstack ; point SP to top ; EXPAND BRK - xor rdi, rdi ; brk syscall called with 0 gives the current brk - mov rax, __NR_brk - syscall - mov qword [here], rax - mov qword [h0], rax - - add rax, 0x9c400 ; 640kb, entirely arbitrary - mov rdi, rax - mov rax, __NR_brk - syscall ; if this fails, have fun - mov qword [hend], rax + ; xor rdi, rdi ; brk syscall called with 0 gives the current brk + ; mov rax, __NR_brk + ; syscall + ; mov qword [here], rax + ; mov qword [h0], rax + ; + ; add rax, 0x9c400 ; 640kb, entirely arbitrary + ; mov rdi, rax + ; mov rax, __NR_brk + ; syscall ; if this fails, have fun + ; mov qword [hend], rax call interpret mov rdi, 0 @@ -298,13 +302,13 @@ defword "compile,", compile_comma, 0 mov r12, [here] ; compile mov r11, [cfa] - mov word [r12], 0x94bb + mov word [r12], 0xbb49 add r12, 2 mov qword [r12], r11 add r12, 8 ; compile call r11 - mov word [r12], 0x41ff + mov word [r12], 0xff41 add r12, 2 mov byte [r12], 0xd3 inc r12 @@ -406,13 +410,13 @@ defword "lit", lit, immediate_mask ; C: ( n -- ) ( -- n ) pspop r11 mov r12, [here] - mov dword [r12], 0x4d8d76f8 + mov dword [r12], 0xf8768d4d add r12, 4 - mov word [r12], 0x49bb + mov word [r12], 0xbb49 add r12, 2 mov qword [r12], r11 add r12, 8 - mov word [r12], 0x4d89 + mov word [r12], 0x894d add r12, 2 mov byte [r12], 0x1e inc r12 @@ -573,9 +577,9 @@ defword "HEREDUMP", heredump, 0 defvar ">in", to_in, 0, 0 defvar "state", state, 0, interpreting -defvar "here", here, 0, 0 -defvar "h0", h0, 0, 0 ; beginning of user memory area -defvar "hend", hend, 0, 0 ; ending of user memory area +defvar "here", here, 0, umem +defvar "h0", h0, 0, umem ; beginning of user memory area +defvar "hend", hend, 0, umem_e ; ending of user memory area defvar "latest", latest, 0, lfa_latest initfile: |
