summaryrefslogtreecommitdiff
path: root/sanctuary.s
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-03-19 17:46:09 +1100
committerkitty <nepeta@canaglie.net>2026-03-19 17:46:09 +1100
commite8d44270cde4c9e3149cde0ab9ae6bf58cd05578 (patch)
tree5ff0fdeabba7fe29c43ee02f404c172bb6bcf282 /sanctuary.s
parentd1cee77ae93afa7bf6b6263933c9199e226530ef (diff)
`grow` calls `executable`
Diffstat (limited to 'sanctuary.s')
-rw-r--r--sanctuary.s13
1 files changed, 7 insertions, 6 deletions
diff --git a/sanctuary.s b/sanctuary.s
index f1a7047..f9fc5f0 100644
--- a/sanctuary.s
+++ b/sanctuary.s
@@ -73,12 +73,6 @@ _start:
mov r11, init_brk
pspush r11
call grow
- ; TODO grow should call executable automatically
- mov r11, qword [dp0]
- pspush r11
- mov r11, init_brk
- pspush r11
- call executable
call interpret
call bye
@@ -97,6 +91,13 @@ defcode "grow", grow, 0
mov rax, __NR_brk
syscall
mov qword [dp$], rax
+ ; this marks the *whole user memory* as executable.
+ ; technically redundant but i think it's fine
+ mov r14, qword [dp0]
+ pspush r14
+ sub rax, r14
+ pspush rax
+ call executable
ret
defcode "executable", executable, 0