Closed bobcyc closed 4 years ago
Hi bobcyc
Thank you for creating this issue - you are correct.
I've updated the atoi function to skip the division by 10 when a non-integer value is passed to this function; https://github.com/DGivney/assemblytutorials/commit/c58bffb7e8c7290e32c3680b525da7c616d1979c#diff-1128b2227978f400f05023dc2b7eb023
Thanks again,
Daniel
From asmtutor.com, lesson 16, the asm code which should be discarding non-number arguments seems to fail.
cmp bl, 48
jl finished
cmp bl, 57
jg finished
For example:
~$ ./exe/lesson16 1 2 3 4 e Floating point exception ~$ ./exe/lesson16 1 2 3 e 2576980383 ~$ ./exe/lesson16 1 2 3 4 10 ~$ ./exe/lesson16 e 1 2 3 6 ~$ ./exe/lesson16 e 2 e 3 858993464