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
|
|
15 psect IS_XDIGIT,0,0,0,0,0
|
|
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
|