Mercurial > hg > Members > kono > nitros9-code
comparison lib/alib/bin2hex.a @ 2474:7d70b7e1cb21
Moved net and alib files into here
author | boisy |
---|---|
date | Tue, 30 Mar 2010 02:44:42 +0000 |
parents | |
children | aaba193af04f |
comparison
equal
deleted
inserted
replaced
2473:dac1ff96637f | 2474:7d70b7e1cb21 |
---|---|
1 **************************************** | |
2 | |
3 * Convert hex byte to 2 hex digits | |
4 | |
5 * OTHER MODULES REQUIRED: none | |
6 | |
7 * ENTRY: B= value to convert | |
8 | |
9 * EXIT: D=2 byte hex digits | |
10 | |
11 | |
12 nam Convert Byte to Hex | |
13 ttl Assembler Library Module | |
14 | |
15 psect BIN2HEX,0,0,0,0,0 | |
16 | |
17 BIN2HEX: | |
18 pshs b | |
19 lsrb get msn | |
20 lsrb | |
21 lsrb | |
22 lsrb fall through to convert msn and return | |
23 bsr ToHex | |
24 tfr b,a 1st digit in A | |
25 puls b get lsn | |
26 andb #%00001111 keep msn | |
27 | |
28 ToHex | |
29 addb #'0 convert to ascii | |
30 cmpb #'9 | |
31 bls ToHex1 | |
32 addb #7 convert plus 9 to A..F | |
33 ToHex1 | |
34 rts | |
35 | |
36 endsect | |
37 |