1 ;;; This file defines "memory access words"
3 WORD p_tfa2cfa,'TFA>CFA',fasm
5 ;; Advance a word tfa pointer to the cfa field
11 WORD p_tfa2dfa,'TFA>DFA',fasm
13 ;; Advance a word tfa pointer to the dfa field
19 WORD p_dfa2tfa,'DFA>TFA',fasm
21 ;; Advance a word tfa pointer to the dfa field
23 mov rax,qword [rax-24] ; tfa
29 ;; Load value v from address addr
36 ;; Store value v at address addr.
42 WORD p_Cget, 'C@',fasm
44 ;; Load the (unsigned) byte v from address addr.
51 WORD p_Cput, 'C!',fasm
53 ;; Store byte value v at address addr.
59 WORD p_2get, '2@',fasm
61 ;; Load the cell pair {v1,v2} from address addr.
63 push qword [rax+8] ; v2
67 WORD p_2put, '2!',fasm
69 ;; Store value pair {v1,v2} at address addr.
72 mov qword [rax], rbx ; v1
74 mov qword [rax+8], rbx ; v2
77 WORD p_erase, 'ERASE',fasm
79 ;; Clear u bytes at address addr and up.
86 mov qword [rbx],0 ; mov qword[rbx],rcx
91 mov [rbx],byte 0 ; mov byte [rbx], cl
98 WORD p_1plus, '1+',fasm
100 ;; Add one (1) to n1 resulting in n2.
104 WORD p_plus_put, '+!',fasm
106 ;; Add n to the value at addr.
112 WORD p_1minus, '1-',fasm
114 ;; Subtract one (1) from n1 resulting in n2.
118 WORD p_2mult, '2*',fasm
120 ;; x2 is the result of shifting x1 one bit toward the
121 ;; most-significant bit, filling the vacated least-significant
126 WORD p_2div, '2/',fasm
128 ;; x2 is the result of shifting x1 one bit toward the
129 ;; least-significant bit, leaving the most-significant bit
130 ;; unchanged. (signed right shift)