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
31 WORD p_cfa2flags_get,'CFA>FLAGS@',fasm
38 WORD p_dfa2tfa,'DFA>TFA',fasm
40 ;; Advance a word tfa pointer to the dfa field
42 mov rax,qword [rax-24] ; tfa
48 ;; Load value v from address addr
55 ;; Store value v at address addr.
61 WORD p_Cget, 'C@',fasm
63 ;; Load the (unsigned) byte v from address addr.
70 WORD p_Cput, 'C!',fasm
72 ;; Store byte value v at address addr.
78 WORD p_2get, '2@',fasm
80 ;; Load the cell pair {v1,v2} from address addr.
82 push qword [rax+8] ; v2
86 WORD p_2put, '2!',fasm
88 ;; Store value pair {v1,v2} at address addr.
91 mov qword [rax], rbx ; v1
93 mov qword [rax+8], rbx ; v2
96 WORD p_erase, 'ERASE',fasm
98 ;; Clear u bytes at address addr and up.
105 mov qword [rbx],0 ; mov qword[rbx],rcx
110 mov [rbx],byte 0 ; mov byte [rbx], cl
117 WORD p_put_plus, '!+',fasm
119 ;; Add n to the value at addr.
125 WORD p_shift_left, '<<',fasm
127 ;; x2 is the result of shifting x1 one bit toward the
128 ;; most-significant bit, filling the vacated least-significant
134 WORD p_shift_right, '>>',fasm
136 ;; x2 is the result of shifting x1 one bit toward the
137 ;; least-significant bit, leaving the most-significant bit
138 ;; unchanged. (signed right shift)
143 WORD p_shift_signed_right, 's>>',fasm
145 ;; x2 is the result of shifting x1 one bit toward the
146 ;; least-significant bit, leaving the most-significant bit
147 ;; unchanged. (signed right shift)
152 WORD p_get_n_increment,'@n++',fasm
154 ;; Fetch value at address then increment that address by n
161 WORD p_get_n_decrement,'@n--',fasm
163 ;; Fetch value at address then decrement that address by n