From dd99a1e5f8fb8209ce62d714b5d6bc30a7492a09 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Fri, 21 May 2021 05:22:06 +1000 Subject: [PATCH] added return stack access primitives --- stack.asm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/stack.asm b/stack.asm index 9726cc2..91be19d 100644 --- a/stack.asm +++ b/stack.asm @@ -119,3 +119,26 @@ p_roll_eq: push rbx push rax next + +;;; ======================================== +;;; Return stack operations + + WORD p_ltR, '>R',fasm + ;; ( x -- ) ( R: -- x ) + ;; Move x to the return stack. + pop rax + pushr rax + next + + WORD p_Rgt, 'R>',fasm + ;; ( -- x ) ( R: x -- ) + ;; Move x from the return stack to the data stack. + popr rax + push rax + next + + WORD p_Rget, 'R@',fasm + ;; ( -- x ) ( R: x -- x ) + ;; Copy x from the return stack to the data stack. + push qword [rbp] + next -- 2.39.2