From: Ralph Ronnquist Date: Thu, 20 May 2021 19:22:06 +0000 (+1000) Subject: added return stack access primitives X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=dd99a1e5f8fb8209ce62d714b5d6bc30a7492a09;p=rrq%2Frrqforth.git added return stack access primitives --- 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