Алексей Волков P3213
6 unresolved threads
Update lib.asm, colon.inc, dict.asm, dict.inc, lib.inc, main.asm, makefile, test.py, words.inc files
- Last updated by Alexey Volkov P3213
140 xor rax, rax 141 ret 142 143 144 145 146 147 148 149 150 151 152 ; Читает один символ из stdin и возвращает его. Возвращает 0 если достигнут конец потока 153 read_char: 154 mov rdi, STDIN ; дескриптор stdin 155 mov rax, 0 ; read в rax changed this line in version 2 of the diff
- Last updated by Alexey Volkov P3213
78 ; Совет: выделите место в стеке и храните там результаты деления 79 ; Не забудьте перевести цифры в их ASCII коды. 80 print_uint: 81 mov rax, rdi ; перенесем число в rax 82 xor rdx, rdx ; занулим rdx 83 mov rcx, 10 84 mov r10, rsp ; для сохранения вершины стека 85 dec rsp 86 mov byte[rsp],dl ; добавим нуль-терминатор 87 .loop: 88 xor rdx, rdx 89 div rcx 90 add rdx,'0' ; первод в ASCII символ 91 dec rsp 92 mov byte[rsp],dl 93 cmp rax,0 ; rax>0 продолжим цикл changed this line in version 2 of the diff
- Last updated by Alexey Volkov P3213
14 section .text 15 global _start 16 17 _start: 18 mov rdi, buffer 19 mov rsi, BUFFER_SIZE 20 call read_word 21 test rax, rax 22 jz .too_long_word 23 mov rsi, first_word 24 mov rdi, buffer 25 call find_word 26 test rax, rax 27 jz .not_found_word 28 mov rdi, rax 29 add rdi, 8 changed this line in version 3 of the diff
- Last updated by Alexey Volkov P3213
6 global print_newline 7 global print_uint 8 global print_int 9 global string_equals 10 global read_char 11 global read_word 12 global parse_uint 13 global parse_int 14 global string_copy 15 %define STDOUT 1 16 %define STDIN 0 17 %define TAB `\t` 18 %define NEWLINE `\n` 19 %define SPACE ` ` 20 %define WRITE_SYSCALL 1 21 %define EXIT_SYSCALL 60 - Last updated by Alexey Volkov P3213
1 %include "lib.inc" 2 3 global find_word 4 5 find_word: 6 push r12 7 test rsi, rsi 8 jz .exit 9 10 .loop: 11 mov r12, rsi 12 add rsi, 8 changed this line in version 3 of the diff
- Last updated by Alexey Volkov P3213
103 104 105 106 107 ; Выводит знаковое 8-байтовое число в десятичном формате 108 print_int: 109 test rdi,rdi 110 jge .number 111 push rdi 112 mov rdi, '-' 113 call print_char 114 pop rdi 115 neg rdi 116 .number: 117 call print_uint 118 ret changed this line in version 3 of the diff
@andrew Внес фиксы, посмотрите пожалуйста
Всё ок, вопросов нет, @andrew , @E1izabeth