From aa1061032d57667c5b53ab445b7942f3bbf6f681 Mon Sep 17 00:00:00 2001 From: kitty Date: Mon, 16 Feb 2026 23:40:35 +1100 Subject: jonesforth port improvements of stack words --- jefs.s | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'jefs.s') diff --git a/jefs.s b/jefs.s index f5c2858..adede03 100644 --- a/jefs.s +++ b/jefs.s @@ -582,20 +582,14 @@ defword "syscall3", syscall3, 0 ; ( rdx rsi rdi id -- rax ) ret ; stack {{{ -; these stack wrangling words are dreadfully inefficient right now -; i will come back and make these less terrible later defword "dup", dup, 0 mov r11, [r14] pspush r11 ret defword "2dup", twodup, 0 ; ( a b -- a b a b ) - ; todo inefficient - pspop r11 - pspop r12 - - pspush r12 - pspush r11 + mov r11, [r14] + mov r12, [r14+8] pspush r12 pspush r11 ret @@ -609,12 +603,7 @@ defword "swap", swap, 0 ret defword "over", over, 0 - ; TODO inefficient (use r14 ptr arith to only push once) - pspop r11 - pspop r12 - - pspush r11 - pspush r12 + mov r11, [r14+8] pspush r11 ret -- cgit v1.2.3