We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fae1832 commit fae1f47Copy full SHA for fae1f47
count.asm
@@ -52,19 +52,19 @@ program_header: ; Elf64_Phdr
52
_start: ; argc is at `rsp`, argv is at `rsp + 8`
53
mov rdi, [rsp + 16] ; put argv[1] into `rdi` (+ 8 to skip argv[0])
54
55
- xor rcx, rcx ; zero
56
- xor rax, rax ; zero
+ xor ecx, ecx ; zero
+ xor eax, eax ; zero
57
from_decimal_loop:
58
movzx rdx, byte [rdi + rcx]
59
- sub rdx, '0'
+ sub edx, '0'
60
61
- mov rbx, rax
62
- shl rax, 3
63
- shl rbx, 1
64
- add rax, rbx
+ mov ebx, eax
+ shl eax, 3
+ shl ebx, 1
+ add eax, ebx
65
66
- add rax, rdx
67
- inc rcx
+ add eax, edx
+ inc ecx
68
cmp byte [rdi + rcx], 0
69
jne from_decimal_loop
70
0 commit comments