- WORD p_branch,'BRANCH',fasm
- ;; ( -- )
- ;; Using subsequent inline cell as branch offset, branch
- ;; accordingly
- add rsi,qword [rsi]
- add rsi,8
- next
-
- WORD p_zero_branch,'0BRANCH',fasm
- ;; ( v -- )
- ;; Using subsequent inline cell as branch offset, branch
- ;; accordingly if the stacked value is zero, otherwise just
- ;; skip over the branch offset
- pop rax
- cmp rax,0
- jne p_zero_branch_SKIP
- add rsi,qword [rsi]
-p_zero_branch_SKIP:
- add rsi,8
- next
-
-;;; Execution semantics for FORTH defition word
-;;; At entry, rsi points into the calling definition, at the cell
-;;; following the cell indicating this word, rax points to the CFA of
-;;; this word.
-doforth:
- pushr rsi
- lea rsi, [rax+8] ; rsi = the DFA of the rax word
- next
-
-;;; Execution semantics for DOES>
-;;; The cell at [cfa-8] holds an adjustment offset.
-dodoes:
- pushr rsi
- lea rsi, [rax+8] ; rsi = the DFA of the rax word
- add rsi,[rax-8] ; adjust rsi to the DOES> part
- next
-
- ;; Execution semantics for a variable ( -- addr )
- ;; rax points to CFA field
-dovariable:
- add rax,8
- push rax
- next
-
- ;; Execution semantics for a constant ( -- v )
- ;; rax points to CFA field
-dovalue:
- push qword [rax+8]
- next
-
- ;; Execution semantics for a string constant ( -- addr n )
- ;; rax points to CFA field
-dostring:
- cfa2dfa rax
- pushpname rax
- next