annotate lib/alib/bin2hex.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
1 ****************************************
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
2
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
3 * Convert hex byte to 2 hex digits
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
4
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
5 * OTHER MODULES REQUIRED: none
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
6
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
7 * ENTRY: B= value to convert
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
8
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
9 * EXIT: D=2 byte hex digits
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
10
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
11
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
12 nam Convert Byte to Hex
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
13 ttl Assembler Library Module
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
14
2782
aaba193af04f Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents: 2474
diff changeset
15 section .text
2474
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
16
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
17 BIN2HEX:
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
18 pshs b
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
19 lsrb get msn
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
20 lsrb
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
21 lsrb
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
22 lsrb fall through to convert msn and return
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
23 bsr ToHex
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
24 tfr b,a 1st digit in A
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
25 puls b get lsn
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
26 andb #%00001111 keep msn
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
27
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
28 ToHex
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
29 addb #'0 convert to ascii
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
30 cmpb #'9
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
31 bls ToHex1
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
32 addb #7 convert plus 9 to A..F
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
33 ToHex1
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
34 rts
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
35
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
36 endsect
7d70b7e1cb21 Moved net and alib files into here
boisy
parents:
diff changeset
37