~vdupras/tumbleforth

8c891cbe82775559f9cd00f9192b79bab06eb6eb — Virgil Dupras 10 months ago 047b75f
01-duskcc/06-taletwostacks: fix parsedecimal description

Thanks Steve.
1 files changed, 7 insertions(+), 7 deletions(-)

M 01-duskcc/06-taletwostacks.md
M 01-duskcc/06-taletwostacks.md => 01-duskcc/06-taletwostacks.md +7 -7
@@ 126,16 126,16 @@ This is the first time that we use a flag as a return value for our routine.
What this means is that after having called the routine, one can directly use
`jz` or `jnz` to jump according to parsing success. No `cmp` necessary.

The routine goes as
follow:
The routine goes as follow:

1. Result starts at 0.
2. Multiply result by 10.
3. Get next char.
4. Is it zero? We’re done, number is good.
5. Is it outside the ‘0’ and ‘9’ range? Not a number, bail out.
6. Subtract ASCII ‘0’ to the character and add it to the accumulating result.
7. Goto 2.
3. Get char and increment index to next char.
4. Subtract ASCII ‘0’ from the character.
5. Is it outside the 0 and 9 range? Not a number, bail out.
6. Is next char zero? We’re done, number is good.
7. Add the number to the accumulating result.
8. Goto 2.

You’ll notice that the routine is broken on empty strings, but since our input
come exclusively from `readword` which can’t yield an empty string, everything