summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-03-23 09:00:29 +0800
committerTat-Chee Wan (USM)2011-03-23 09:00:29 +0800
commit9c6c02f8557a1aa44c344024bd8e67af6816cd67 (patch)
tree94d43cd8cc8687794bb69c784a37a130106c4675
parent1fe10665ea04f53f336676e88712391b7e5331da (diff)
fix char2hex to allow lower case ascii hex chars
-rw-r--r--Debugger/debug_comm.S9
1 files 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