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_tfa2flags_get,'TFA>FLAGS@',fasm
25 WORD p_tfa2namez,'TFA>NAMEZ',fasm
32 WORD p_cfa2tfa,'CFA>TFA',fasm
39 WORD p_cfa2flags_get,'CFA>FLAGS@',fasm
46 WORD p_dfa2tfa,'DFA>TFA',fasm
48 ;; Advance a word tfa pointer to the dfa field
50 mov rax,qword [rax-24] ; tfa
56 ;; Load value v from address addr
63 ;; Store value v at address addr.
69 WORD p_Cget, 'C@',fasm
71 ;; Load the (unsigned) byte v from address addr.
78 WORD p_Cput, 'C!',fasm
80 ;; Store byte value v at address addr.
86 WORD p_Wget, 'W@',fasm
88 ;; Load the (unsigned) double-byte v from address addr.
95 WORD p_Wput, 'W!',fasm
97 ;; Store byte value v at address addr.
103 WORD p_Dget, 'D@',fasm
105 ;; Load the (unsigned) double-byte v from address addr.
112 WORD p_Dput, 'D!',fasm
114 ;; Store byte value v at address addr.
120 WORD p_2get, '2@',fasm
122 ;; Load the cell pair {v1,v2} from address addr.
124 push qword [rax+8] ; v2
125 push qword [rax] ; v1
128 WORD p_2put, '2!',fasm
130 ;; Store value pair {v1,v2} at address addr.
133 mov qword [rax], rbx ; v1
135 mov qword [rax+8], rbx ; v2
138 WORD p_erase, 'ERASE',fasm
140 ;; Clear u bytes at address addr and up.
147 mov qword [rbx],0 ; mov qword[rbx],rcx
152 mov [rbx],byte 0 ; mov byte [rbx], cl
159 WORD p_put_plus, '!+',fasm
161 ;; Add n to the value at addr.
167 WORD p_shift_left, '<<',fasm
169 ;; x2 is the result of shifting x1 one bit toward the
170 ;; most-significant bit, filling the vacated least-significant
176 WORD p_shift_right, '>>',fasm
178 ;; x2 is the result of shifting x1 one bit toward the
179 ;; least-significant bit, leaving the most-significant bit
180 ;; unchanged. (signed right shift)
185 WORD p_shift_signed_right, 's>>',fasm
187 ;; x2 is the result of shifting x1 one bit toward the
188 ;; least-significant bit, leaving the most-significant bit
189 ;; unchanged. (signed right shift)
194 WORD p_get_n_increment,'@n++',fasm
196 ;; Fetch value at address then increment that address by n
203 WORD p_get_n_decrement,'@n--',fasm
205 ;; Fetch value at address then decrement that address by n