From: Ralph Ronnquist Date: Tue, 18 May 2021 01:46:51 +0000 (+1000) Subject: avoid dropping first character X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=135bac77e9403714670d582b59255f2588ec83fb;p=rrq%2Frrqforth.git avoid dropping first character --- diff --git a/stdio.asm b/stdio.asm index ae3e08e..fed8eda 100644 --- a/stdio.asm +++ b/stdio.asm @@ -108,6 +108,7 @@ p_read_stream_char.CHAR: push qword p_line_buffer_DFA push qword 0 push rax + p_read_word_skipblanks: FORTH dq p_dup @@ -118,7 +119,13 @@ p_read_word_skipblanks: jl p_read_word_nomore cmp bl,' ' jle p_read_word_skipblanks + p_read_word_readword: + ;; ( buffer length stream ) + mov rax,qword [rsp+16] + mov rcx,qword [rsp+8] + mov [rax+rcx],bl + inc qword [rsp+8] FORTH dq p_dup dq p_read_stream_char @@ -127,13 +134,8 @@ p_read_word_readword: cmp bl,0 jl p_read_word_nomore cmp bl,' ' - jle p_read_word_nomore - ;; ( buffer length stream ) - mov rax,qword [rsp+16] - mov rcx,qword [rsp+8] - mov [rax+rcx],bl - inc qword [rsp+8] - jmp p_read_word_readword + jg p_read_word_readword + p_read_word_nomore: pop rax popr rsi