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_tfa2flags_get,'TFA>FLAGS@',fasm
32 WORD p_dfa2tfa,'DFA>TFA',fasm
34 ;; Advance a word tfa pointer to the dfa field
36 mov rax,qword [rax-24] ; tfa
42 ;; Load value v from address addr
49 ;; Store value v at address addr.
55 WORD p_Cget, 'C@',fasm
57 ;; Load the (unsigned) byte v from address addr.
64 WORD p_Cput, 'C!',fasm
66 ;; Store byte value v at address addr.
72 WORD p_2get, '2@',fasm
74 ;; Load the cell pair {v1,v2} from address addr.
76 push qword [rax+8] ; v2
80 WORD p_2put, '2!',fasm
82 ;; Store value pair {v1,v2} at address addr.
85 mov qword [rax], rbx ; v1
87 mov qword [rax+8], rbx ; v2
90 WORD p_erase, 'ERASE',fasm
92 ;; Clear u bytes at address addr and up.
99 mov qword [rbx],0 ; mov qword[rbx],rcx
104 mov [rbx],byte 0 ; mov byte [rbx], cl
111 WORD p_1plus, '1+',fasm
113 ;; Add one (1) to n1 resulting in n2.
117 WORD p_plus_put, '+!',fasm
119 ;; Add n to the value at addr.
125 WORD p_1minus, '1-',fasm
127 ;; Subtract one (1) from n1 resulting in n2.
131 WORD p_2mult, '2*',fasm
133 ;; x2 is the result of shifting x1 one bit toward the
134 ;; most-significant bit, filling the vacated least-significant
139 WORD p_2div, '2/',fasm
141 ;; x2 is the result of shifting x1 one bit toward the
142 ;; least-significant bit, leaving the most-significant bit
143 ;; unchanged. (signed right shift)