X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=memory.asm;h=171ac487c8a19b40a533c51a1e62e2b5dd73c740;hb=a3427c86d68cc40ac6f9ed1bd153bb45f0456b55;hp=6e945ff3331fbe6fd5639f33806dbb795545dde3;hpb=f4d2168559fb02a720623e3c44a48efa4e4a6614;p=rrq%2Frrqforth.git diff --git a/memory.asm b/memory.asm index 6e945ff..171ac48 100644 --- a/memory.asm +++ b/memory.asm @@ -1,5 +1,36 @@ ;;; This file defines "memory access words" + WORD p_cfa2flags_get,'CFA>FLAGS@',fasm + ;; ( cfa -- flags ) + pop rax + cfa2tfa rax + push qword[rax+16] + next + + WORD p_tfa2cfa,'TFA>CFA',fasm + ;; ( tfa -- cfa ) + ;; Advance a word tfa pointer to the cfa field + mov rax,qword[rsp] + tfa2cfa rax + mov qword [rsp],rax + next + + WORD p_tfa2dfa,'TFA>DFA',fasm + ;; ( tfa -- dfa ) + ;; Advance a word tfa pointer to the dfa field + mov rax,qword[rsp] + tfa2dfa rax + mov qword [rsp],rax + next + + WORD p_dfa2tfa,'DFA>TFA',fasm + ;; ( dfa -- tfa ) + ;; Advance a word tfa pointer to the dfa field + mov rax,qword[rsp] + mov rax,qword [rax-24] ; tfa + mov qword [rsp],rax + next + WORD p_get, '@',fasm ;; ( addr -- v ) ;; Load value v from address addr