From 152e6c7fd4a00e4fd56d5a55aaaa4c3680eaa815 Mon Sep 17 00:00:00 2001 From: kitty Date: Mon, 16 Mar 2026 12:24:07 +1100 Subject: type and executable swap stack order --- readme.md | 6 +++--- sanctuary.s | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 9a52103..440c02a 100644 --- a/readme.md +++ b/readme.md @@ -40,7 +40,7 @@ a variable that contains the first byte of user memory. ### `dp$ ( -- )` a variable that contains the last available byte of user memory. -### `executable ( u a -- )` +### `executable ( a u -- )` marks the u bytes starting at address a as executable. this is used primarily to mark the program break, which is used as the user memory space. @@ -61,7 +61,7 @@ yields the address of the first available byte in user memory. a variable containing the execution token of the most recently created word. -### `parse ( "name" c -- a u )` +### `parse ( "name" c -- a u )` parse one word from the input buffer, separated by a newline or the character c, and return as a string. @@ -80,7 +80,7 @@ if -1 (true), the system is in compiling mode. ### `tib ( -- a )` a variable containing the address of the current input buffer. -### `type ( u a -- )` +### `type ( a u -- )` write u characters at a to output. ## dictionary format diff --git a/sanctuary.s b/sanctuary.s index 18c6623..30a9f5b 100644 --- a/sanctuary.s +++ b/sanctuary.s @@ -94,8 +94,8 @@ defcode "grow", grow, 0 defcode "executable", executable, 0 mov rdx, 0x7 ; PROT_{READ,WRITE,EXEC} - pspop rdi ; addr pspop rsi + pspop rdi ; addr mov rax, __NR_mprotect syscall ret @@ -223,8 +223,8 @@ defcode "parse", parse, 0 ; }}} defcode "type", type, 0 - pspop rdx pspop rsi + pspop rdx mov rdi, 1 mov rax, __NR_write syscall -- cgit v1.2.3