+;; Given a string (a pointer following by a size), return the location of the
+;; dictionary entry for that word. If no such word exists, return 0.
+forth_asm FIND, 'FIND'
+ mov [.rsi], rsi
+ pop [.search_length]
+ pop [.search_buffer]
+
+ ;; RSI contains the entry we are currently looking at
+ mov rsi, [latest_entry] ; Start with the last added word
+
+.loop:
+ movzx rcx, byte [rsi + 8] ; Length of word being looked at
+ cmp rcx, [.search_length]
+ jne .next ; If the words don't have the same length, we have the wrong word
+
+ ;; Otherwise, we need to compare strings
+ lea rdx, [rsi + 8 + 1] ; Location of character being compared in entry
+ mov rdi, [.search_buffer] ; Location of character being compared in search buffer
+.compare_char:
+ mov al, [rdx]
+ mov ah, [rdi]
+ cmp al, ah
+ jne .next ; They don't match; try again
+ inc rdx ; These characters match; look at the next ones
+ inc rdi
+ loop .compare_char
+
+ jmp .found ; They match! We are done.
+
+.next:
+ mov rsi, [rsi] ; Look at the previous entry
+ cmp rsi, 0
+ jnz .loop ; If there is no previous word, exit and return 0
+
+.found:
+ push rsi
+
+ mov rsi, [.rsi]
+ next
+
+;; Given an entry in the dictionary, return a pointer to the codeword of that
+;; entry.
+forth_asm TCFA, '>CFA'
+ pop rax
+ add rax, 8 ; [rax] = length of name
+ movzx rbx, byte [rax]
+ inc rax
+ add rax, rbx ; [rax] = codeword
+ push rax
+ next
+