X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=memory.asm;h=a20c438971de084a45e52219c153a79e9a556753;hb=cabd8413c10848728efcc2b869f631294f755d4d;hp=80ce28075e6c69a6e5523f3336ed7532a0dbe6f3;hpb=d5613f1ba2ae4065d60df8e768027f437f740a7f;p=rrq%2Frrqforth.git diff --git a/memory.asm b/memory.asm index 80ce280..a20c438 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 @@ -63,9 +70,9 @@ ;; ( addr -- v ) ;; Load the (unsigned) byte v from address addr. pop rax - mov bl,[rax] - push 0 - mov [rsp],bl + xor rbx,rbx + mov bl,byte [rax] + push rbx next WORD p_Cput, 'C!',fasm @@ -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 + xor rbx,rbx + mov bx,word [rax] + push rbx + 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 + xor rbx,rbx + mov ebx,dword [rax] + push rbx + 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. @@ -120,7 +161,7 @@ p_erase_last: ;; Add n to the value at addr. pop rbx pop rax - add [rax],rbx + add qword [rax],rbx next WORD p_shift_left, '<<',fasm