projects
/
rrq
/
rrqforth.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changes to QUIT (the main program).. still testing
[rrq/rrqforth.git]
/
wordlists.asm
diff --git
a/wordlists.asm
b/wordlists.asm
index 4862dd1ec8994ef32dfe3cd949cedd484473d1ce..705f360927b5dd001be626ecdde81721efa63b12 100644
(file)
--- a/
wordlists.asm
+++ b/
wordlists.asm
@@
-98,39
+98,40
@@
p_strncmp_end:
push rcx
next
push rcx
next
- WORD p_find,'FIND'
- ;; ( chars
length -- [ chars 0 | cfa 1
)
+ WORD p_find,'FIND'
,fasm
+ ;; ( chars
* length -- [ chars* length 0 ]|[ tfa ]
)
;; Search the current wordlists for the given pname
pushr rsi
mov rcx,[p_wordlist_DFA]
;; Search the current wordlists for the given pname
pushr rsi
mov rcx,[p_wordlist_DFA]
- mov rcx,qword [rcx]
- mov rbx,
[rsp]
- mov r
ax,[rsp+8]
+ mov rcx,qword [rcx]
; use rcx for word list traversing
+ mov rbx,
qword [rsp] ; rbx is input length
+ mov r
si,qword [rsp+8] ; rsi is input chars*
p_find_loop:
cmp rcx,0
p_find_loop:
cmp rcx,0
- je p_find_
done
+ je p_find_
notfound ; jump at end of word list
cmp rbx,qword [rcx+16] ; compare lengths
cmp rbx,qword [rcx+16] ; compare lengths
- jne p_find_nextword
- push rcx
+ jne p_find_nextword
; jump on length mismatch
+ push rcx
; save tfa for later
;; check word
;; check word
- push r
ax
+ push r
si ; input chars
tfa2pname rcx
tfa2pname rcx
- push rcx
- push rbx
+ push rcx
; word chars
+ push rbx
; length
DOFORTH p_strncmp
pop rax ; return value
DOFORTH p_strncmp
pop rax ; return value
- pop rcx
+ pop rcx
; restore tfa
cmp rax,0
cmp rax,0
- je p_find_
done
- mov rbx,[rsp]
- mov r
ax,
[rsp+8]
+ je p_find_
found
+ mov rbx,
qword
[rsp]
+ mov r
si,qword
[rsp+8]
p_find_nextword:
p_find_nextword:
- mov rcx,[rcx]
+ mov rcx,
qword
[rcx]
jmp p_find_loop
jmp p_find_loop
+p_find_notfound:
+ xor rcx,rcx
+ sub rsp,16
p_find_found:
p_find_found:
- mov qword [rsp+8],rcx ; replace chars with tfa
- mov rcx,1
-p_find_done:
- push rcx
+ add rsp,8
+ mov qword [rsp],rcx ; replace with tfa / 0
popr rsi
next
popr rsi
next