X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=memory.asm;h=eb84af7feb42e98616bdfb6e9f01d2e1a5d47333;hb=0a436d5323363af19679ca0a1795b996dc886cfa;hp=80ce28075e6c69a6e5523f3336ed7532a0dbe6f3;hpb=d5613f1ba2ae4065d60df8e768027f437f740a7f;p=rrq%2Frrqforth.git diff --git a/memory.asm b/memory.asm index 80ce280..eb84af7 100644 --- a/memory.asm +++ b/memory.asm @@ -29,6 +29,13 @@ push rax next + WORD p_cfa2tfa,'CFA>TFA',fasm + ;; ( cfa -- tfa ) + pop rax + cfa2tfa rax + push rax + next + WORD p_cfa2flags_get,'CFA>FLAGS@',fasm ;; ( cfa -- flags ) pop rax @@ -76,6 +83,40 @@ mov byte [rax], bl next + WORD p_Wget, 'W@',fasm + ;; ( addr -- v ) + ;; Load the (unsigned) double-byte v from address addr. + pop rax + mov bx,[rax] + push 0 + mov word [rsp],bx + next + + WORD p_Wput, 'W!',fasm + ;; ( v addr -- ) + ;; Store byte value v at address addr. + pop rax + pop rbx + mov word [rax], bx + next + + WORD p_Dget, 'D@',fasm + ;; ( addr -- v ) + ;; Load the (unsigned) double-byte v from address addr. + pop rax + mov ebx,[rax] + push 0 + mov dword [rsp],ebx + next + + WORD p_Dput, 'D!',fasm + ;; ( v addr -- ) + ;; Store byte value v at address addr. + pop rax + pop rbx + mov dword [rax], ebx + next + WORD p_2get, '2@',fasm ;; ( addr -- v2 v1 ) ;; Load the cell pair {v1,v2} from address addr.