From 9c6c02f8557a1aa44c344024bd8e67af6816cd67 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Wed, 23 Mar 2011 09:00:29 +0800 Subject: fix char2hex to allow lower case ascii hex chars --- Debugger/debug_comm.S | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Debugger/debug_comm.S b/Debugger/debug_comm.S index 75f835e..c5738da 100644 --- a/Debugger/debug_comm.S +++ b/Debugger/debug_comm.S @@ -127,7 +127,10 @@ hex2char: /* char2hex * This routine accepts an ASCII character in R0(7:0) and returns the - * equivalent byte sized hex value in R0(7:0) + * equivalent byte sized hex value in R0(7:0). + * It accepts lowercase and uppercase ASCII Hex char inputs. + * WARNING: The checking is not exhaustive, invalid ASCII characters can + * still slip thorough. */ .global char2hex @@ -135,8 +138,10 @@ char2hex: and r0, #BYTE0 /* make sure that input is sane */ cmp r0, #'0' blo exit_char2hex - cmp r0, #'F' + cmp r0, #'f' bhi exit_char2hex + /* In range '0'..'f' */ +perform_char2hex: _char2hex r0 exit_char2hex: bx lr -- cgit v1.2.3