diff --git a/apps/lib/parse.asm b/apps/lib/parse.asm index c129dd5..d561311 100644 --- a/apps/lib/parse.asm +++ b/apps/lib/parse.asm @@ -17,8 +17,8 @@ ; same conditions as parseLiteral. ; Sets Z on success, unset on error. -; 55 bytes -; 107 cycles overhead + up to 45 cycles if length >= 5 +; 61 bytes +; 107 cycles overhead + up to 73 cycles if length >= 5 ; 136 cycles in loop ; first digit is skipped in overhead parseDecimal: @@ -63,6 +63,12 @@ parseDecimal: add hl, de ex de, hl jr nc, .loop ; if it doesn't carry, it's small enough + + exx + inc hl + ld a, (hl) + exx + add a, 0xd0 .error: sub 0xd0 ; if a is null, set Z ; a is checked for null before any errors