projects
/
rrq
/
rrqforth.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avoid dropping first character
[rrq/rrqforth.git]
/
stdio.asm
diff --git
a/stdio.asm
b/stdio.asm
index ae3e08eaa64a5c3b72e1152bce4161da7a8b8f17..fed8eda38df2fffa598e11bb4f8d7c8d4a26b19e 100644
(file)
--- 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
push qword p_line_buffer_DFA
push qword 0
push rax
+
p_read_word_skipblanks:
FORTH
dq p_dup
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
jl p_read_word_nomore
cmp bl,' '
jle p_read_word_skipblanks
+
p_read_word_readword:
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
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,' '
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
p_read_word_nomore:
pop rax
popr rsi