Mercurial > hg > Members > kono > nitros9-code
annotate lib/alib/is_xdigit.a @ 2782:aaba193af04f lwtools-port
Updated code to use lwasm/lwlink
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Sat, 26 Jan 2013 08:26:31 -0600 |
parents | 7d70b7e1cb21 |
children |
rev | line source |
---|---|
2474 | 1 ***************************************** |
2 | |
3 * See if character in "B" is a hexdigit 0..9, A..F or a..f | |
4 | |
5 * OTHER MODULES NEEDED: IS_DIGIT | |
6 | |
7 * ENTRY: B=character to test | |
8 | |
9 * EXIT: CC zero=1 if hex digit, 0 if not | |
10 | |
11 nam Is Char a Hex Digit? | |
12 ttl Assembler Library Module | |
13 | |
14 | |
2782
aaba193af04f
Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2474
diff
changeset
|
15 section .text |
2474 | 16 |
17 | |
18 IS_XDIGIT: | |
19 pshs b | |
20 lbsr IS_DIGIT | |
21 beq exit digits are okay | |
22 cmpb #'A | |
23 blo exit exit, zero not set | |
24 cmpb #'f | |
25 bhi exit zero not set | |
26 cmpb #'a | |
27 bhs yes | |
28 cmpb #'F | |
29 bhi exit | |
30 | |
31 yes | |
32 orcc #%00000100 set zero | |
33 | |
34 exit | |
35 puls b,pc | |
36 | |
37 endsect | |
38 |