X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=stack.asm;h=91be19d71963d217ee453051f14abdc80cc9d2b2;hb=edbf715e7c803582905f6014272c6f9f3e162edc;hp=9726cc2b8eb2883c2e4df7ad4e2a0f7272427b27;hpb=f3bc3b97f37dd7bc012c152374d4185c734b3a7e;p=rrq%2Frrqforth.git 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