From 2f357c67f0323aafe05e997053b180e6e79d8ea0 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Wed, 19 May 2021 17:46:50 +1000 Subject: [PATCH] debugging FIND --- wordlists.asm | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/wordlists.asm b/wordlists.asm index c67e6c9..705f360 100644 --- a/wordlists.asm +++ b/wordlists.asm @@ -98,37 +98,38 @@ p_strncmp_end: push rcx next - WORD p_find,'FIND' - ;; ( chars length -- [ 0 ]|[ tfa ] ) + 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] - mov rcx,qword [rcx] - mov rbx,[rsp] - mov rax,[rsp+8] + mov rcx,qword [rcx] ; use rcx for word list traversing + mov rbx,qword [rsp] ; rbx is input length + mov rsi,qword [rsp+8] ; rsi is input chars* p_find_loop: cmp rcx,0 - je p_find_notfound + je p_find_notfound ; jump at end of word list cmp rbx,qword [rcx+16] ; compare lengths - jne p_find_nextword + jne p_find_nextword ; jump on length mismatch push rcx ; save tfa for later ;; check word - push rax + push rsi ; input chars tfa2pname rcx - push rcx - push rbx + push rcx ; word chars + push rbx ; length DOFORTH p_strncmp pop rax ; return value pop rcx ; restore tfa cmp rax,0 je p_find_found - mov rbx,[rsp] - mov rax,[rsp+8] + mov rbx,qword [rsp] + mov rsi,qword [rsp+8] p_find_nextword: - mov rcx,[rcx] + mov rcx,qword [rcx] jmp p_find_loop p_find_notfound: xor rcx,rcx + sub rsp,16 p_find_found: add rsp,8 mov qword [rsp],rcx ; replace with tfa / 0 -- 2.39.2