summaryrefslogtreecommitdiff
path: root/sanctuary.s
diff options
context:
space:
mode:
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