1 ;;; This file defines "memory access words"
3 WORD p_cfa2flags_get,'CFA>FLAGS@',fasm
10 WORD p_tfa2cfa,'TFA>CFA',fasm
12 ;; Advance a word tfa pointer to the cfa field
18 WORD p_tfa2dfa,'TFA>DFA',fasm
20 ;; Advance a word tfa pointer to the dfa field
26 WORD p_dfa2tfa,'DFA>TFA',fasm
28 ;; Advance a word tfa pointer to the dfa field
30 mov rax,qword [rax-24] ; tfa
36 ;; Load value v from address addr
43 ;; Store value v at address addr.
49 WORD p_Cget, 'C@',fasm
51 ;; Load the (unsigned) byte v from address addr.
58 WORD p_Cput, 'C!',fasm
60 ;; Store byte value v at address addr.
66 WORD p_2get, '2@',fasm
68 ;; Load the cell pair {v1,v2} from address addr.
70 push qword [rax+8] ; v2
74 WORD p_2put, '2!',fasm
76 ;; Store value pair {v1,v2} at address addr.
79 mov qword [rax], rbx ; v1
81 mov qword [rax+8], rbx ; v2
84 WORD p_erase, 'ERASE',fasm
86 ;; Clear u bytes at address addr and up.
93 mov qword [rbx],0 ; mov qword[rbx],rcx
98 mov [rbx],byte 0 ; mov byte [rbx], cl
105 WORD p_1plus, '1+',fasm
107 ;; Add one (1) to n1 resulting in n2.
111 WORD p_plus_put, '+!',fasm
113 ;; Add n to the value at addr.
119 WORD p_1minus, '1-',fasm
121 ;; Subtract one (1) from n1 resulting in n2.
125 WORD p_2mult, '2*',fasm
127 ;; x2 is the result of shifting x1 one bit toward the
128 ;; most-significant bit, filling the vacated least-significant
133 WORD p_2div, '2/',fasm
135 ;; x2 is the result of shifting x1 one bit toward the
136 ;; least-significant bit, leaving the most-significant bit
137 ;; unchanged. (signed right shift)