diff --git a/src/convert.asm b/src/convert.asm index 5f10c7d..1b5b7da 100644 --- a/src/convert.asm +++ b/src/convert.asm @@ -150,6 +150,12 @@ atoi: .calcNum_cnt: imul r9 + mov rdx, -1 + sub rdx, r10 + cmp rax, rdx + ;TODO: Add signed checks + ja .overflow + add r10, rax dec rdi inc r8 @@ -159,6 +165,10 @@ atoi: .wrapup_neg: neg r10 + jmp .quit + + .overflow: + xor r10, r10 .quit: mov rax, r10