X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=stack.asm;h=637d8aca69da1a778e004f4cee3d4694d089ddaa;hb=39427aee877cab09feea798b146e06dc7bfc25cc;hp=5b6910b5cb3bef019f7e10336ca62a4e05194042;hpb=bf67023324b2a0c5723dd3167ef757209ba62e01;p=rrq%2Frrqforth.git diff --git a/stack.asm b/stack.asm index 5b6910b..637d8ac 100644 --- a/stack.asm +++ b/stack.asm @@ -1,5 +1,14 @@ ;;; Words for stack manipulations + WORD p_dsp,'D[n]',fasm + ;; ( n -- a ) + ;; Push the address of the n:th cell below n onto the stack + pop rax + shl rax,3 + add rax,rsp + push rax + next + WORD p_depth,'DEPTH',fasm ;; ( -- v ) ;; Push stack depth (before push) @@ -152,7 +161,12 @@ p_roll_eq: push qword [rbp] next - WORD p_rsp,'R[n]',fasm + WORD p_rbp,'RSP',fasm + ;; Push the return stack pointer to the data stack + push rbp + next + + WORD p_rbpn,'R[n]',fasm ;; ( n -- a ) ;; push the address of the n:th cell on the return stack mov rax,qword [rsp]