Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
lesswixx
assignment-1-io-library
Commits
33939a63
Commit
33939a63
authored
2 years ago
by
lesswixx
Browse files
Options
Download
Email Patches
Plain Diff
Update lib.inc
parent
f4c54f76
lesswixx-master-patch-41809
No related merge requests found
Pipeline
#38175
failed with stage
in 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
29 deletions
+35
-29
lib.inc
lib.inc
+35
-29
No files found.
lib.inc
View file @
33939a63
...
...
@@ -132,44 +132,50 @@ read_char:
;
При
неудаче
возвращает
0
в
rax
;
Эта
функция
должна
дописывать
к
слову
нуль
-
терминатор
read_word
:
xor
rdx
,
rdx
xor
rax
,
rax
mov
r8
,
rdi
mov
r9
,
rsi
.
read_spaces
:
call
read_char
cmp
al
,
WHITESPACE
je
.
read_spaces
cmp
al
,
TAB
je
.
read_spaces
cmp
al
,
NEXT_LINE
je
.
read_spaces
xor
rdx
,
rdx
.
loop
:
push
rsi
push
rdi
cmp
al
,
NEXT_LINE
je
.
finish
cmp
al
,
WHITESPACE
je
.
finish
cmp
al
,
4
je
.
finish
cmp
al
,
TAB
je
.
finish
cmp
al
,
0
je
.
finish
inc
rdx
cmp
rdx
,
r9
jge
.
overflow
dec
rdx
mov
[
r8
+
rdx
],
al
inc
rdx
push
rdx
push
r8
call
read_char
pop
r8
pop
rdx
pop
rdi
pop
rsi
test
rax
,
rax
je
.
end
cmp
rax
,
WHITESPACE
je
.
space
cmp
rax
,
NEXT_LINE
je
.
space
cmp
rax
,
TAB
je
.
space
mov
byte
[
rdi
+
rdx
],
al
inc
rdx
cmp
rdx
,
rsi
jge
.
overflow
jmp
.
loop
.
space
:
test
rdx
,
rdx
jne
.
end
jmp
.
loop
.
finish
:
mov
byte
[
r8
+
rdx
],
0
mov
rax
,
r8
ret
.
overflow
:
xor
rax
,
rax
xor
rdx
,
rdx
ret
.
finish
:
mov
byte
[
rdi
+
rdx
],
0
mov
rax
,
rdi
ret
;
Принимает
указатель
на
строку
,
пытается
(
rdi
)
;
прочитать
из
её
начала
беззнаковое
число
.
;
Возвращает
в
rax
:
число
,
rdx
:
его
длину
в
символах
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help