From a0ca9d1045f4657e9e39bcfe70db188a16573828 Mon Sep 17 00:00:00 2001 From: Matthew Waltz Date: Thu, 24 Oct 2024 20:06:28 -0600 Subject: [PATCH] [libc] optimize _isdigit --- src/libc/isdigit.src | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/libc/isdigit.src b/src/libc/isdigit.src index 9d37b03aa..f42d724e9 100644 --- a/src/libc/isdigit.src +++ b/src/libc/isdigit.src @@ -3,21 +3,12 @@ section .text public _isdigit _isdigit: - pop hl pop de + ex (sp),hl push de - push hl - or a,a + ld a,l + sub a,48 + add a,-10 sbc hl,hl - bit 7,e - ret nz - ex de,hl - ld de,___maptab - add hl,de - ld a,(hl) - and a,1 - sbc hl,hl - ld l,a + inc hl ret - - extern ___maptab