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_2get, '2@',fasm
88 ;; Load the cell pair {v1,v2} from address addr.
90 push qword [rax+8] ; v2
94 WORD p_2put, '2!',fasm
96 ;; Store value pair {v1,v2} at address addr.
99 mov qword [rax], rbx ; v1
101 mov qword [rax+8], rbx ; v2
104 WORD p_erase, 'ERASE',fasm
106 ;; Clear u bytes at address addr and up.
113 mov qword [rbx],0 ; mov qword[rbx],rcx
118 mov [rbx],byte 0 ; mov byte [rbx], cl
125 WORD p_put_plus, '!+',fasm
127 ;; Add n to the value at addr.
133 WORD p_shift_left, '<<',fasm
135 ;; x2 is the result of shifting x1 one bit toward the
136 ;; most-significant bit, filling the vacated least-significant
142 WORD p_shift_right, '>>',fasm
144 ;; x2 is the result of shifting x1 one bit toward the
145 ;; least-significant bit, leaving the most-significant bit
146 ;; unchanged. (signed right shift)
151 WORD p_shift_signed_right, 's>>',fasm
153 ;; x2 is the result of shifting x1 one bit toward the
154 ;; least-significant bit, leaving the most-significant bit
155 ;; unchanged. (signed right shift)
160 WORD p_get_n_increment,'@n++',fasm
162 ;; Fetch value at address then increment that address by n
169 WORD p_get_n_decrement,'@n--',fasm
171 ;; Fetch value at address then decrement that address by n