comparison lib/alib/bin_hex.as @ 2783:03f26e88b809 lwtools-port

Renamed files and setup for lwasm/lwlink work
author Boisy Pitre <boisy.pitre@nuance.com>
date Sat, 26 Jan 2013 17:18:24 -0600
parents
children
comparison
equal deleted inserted replaced
2782:aaba193af04f 2783:03f26e88b809
1 ********************************************
2 *
3 * Binary to hexadecimal convertor
4 *
5 * This subroutine will convert the binary value in
6 * 'D' to a 4 digit hexadecimal ascii string.
7
8
9 * OTHER MODULES NEEDED: BIN2HEX
10
11 * ENTRY: D=value to convert
12 * X=buffer for hex string-null terminated
13
14 * EXIT all registers (except CC) preserved.
15
16 nam Convert # to Hex String
17 ttl Assembler Library Module
18
19
20 section .text
21
22 BIN_HEX:
23 pshs d,x
24 ldb ,s
25 lbsr BIN2HEX convert 1 byte
26 std ,x++
27 ldb 1,s
28 lbsr BIN2HEX convert 2nd byte
29 std ,x++
30 clr ,x term with null
31 puls d,x
32
33 endsect
34
35