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_cfa2flags_get,'CFA>FLAGS@',fasm
39 WORD p_dfa2tfa,'DFA>TFA',fasm
41 ;; Advance a word tfa pointer to the dfa field
43 mov rax,qword [rax-24] ; tfa
49 ;; Load value v from address addr
56 ;; Store value v at address addr.
62 WORD p_Cget, 'C@',fasm
64 ;; Load the (unsigned) byte v from address addr.
71 WORD p_Cput, 'C!',fasm
73 ;; Store byte value v at address addr.
79 WORD p_2get, '2@',fasm
81 ;; Load the cell pair {v1,v2} from address addr.
83 push qword [rax+8] ; v2
87 WORD p_2put, '2!',fasm
89 ;; Store value pair {v1,v2} at address addr.
92 mov qword [rax], rbx ; v1
94 mov qword [rax+8], rbx ; v2
97 WORD p_erase, 'ERASE',fasm
99 ;; Clear u bytes at address addr and up.
106 mov qword [rbx],0 ; mov qword[rbx],rcx
111 mov [rbx],byte 0 ; mov byte [rbx], cl
118 WORD p_put_plus, '!+',fasm
120 ;; Add n to the value at addr.
126 WORD p_shift_left, '<<',fasm
128 ;; x2 is the result of shifting x1 one bit toward the
129 ;; most-significant bit, filling the vacated least-significant
135 WORD p_shift_right, '>>',fasm
137 ;; x2 is the result of shifting x1 one bit toward the
138 ;; least-significant bit, leaving the most-significant bit
139 ;; unchanged. (signed right shift)
144 WORD p_shift_signed_right, 's>>',fasm
146 ;; x2 is the result of shifting x1 one bit toward the
147 ;; least-significant bit, leaving the most-significant bit
148 ;; unchanged. (signed right shift)
153 WORD p_get_n_increment,'@n++',fasm
155 ;; Fetch value at address then increment that address by n
162 WORD p_get_n_decrement,'@n--',fasm
164 ;; Fetch value at address then decrement that address by n