home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
compuserve
/
Basic
/
PCCHAS.ZIP
/
EXAMPLE1.LST
< prev
next >
Wrap
File List
|
1995-01-08
|
1KB
|
32 lines
BINHEX 99000 FAMILY MACRO ASSEMBLER PC2.1 84.107 22:42:48 01-08-95
Binary To ASCII Hex Conversion Routine PAGE 0001
0002 IDT 'BINHEX'
0003 0000 RORG
0004 DEF BINHEX
0005 REF HEXTXT
0006 *
0007 * IN : R0 Number to be converted
0008 * R1 Buffer to store number in
0009 *
0010 * OUT : R0 Destroyed
0011 * R1 Pointer to end of stored number
0012 * R2 Destroyed
0013 * R3 Destroyed
0014 *
0015 * REF : HEXTXT string
0016 *
0017 0000 0202 BINHEX LI R2,4 4 digits required
0002 0004
0018 0004 C0C0 LOOP MOV R0,R3 copy value
0019 0006 09C3 SRL R3,12 move digit to lsb & zero fill
0020 0008 DC63 MOVB @HEXTXT(R3),*R1+ store the ascii character for
000A 0000
0021 000C 0A40 SLA R0,4 position next digit
0022 000E 0602 DEC R2 done all of the digits ?
0023 0010 16F9 JNE LOOP n, keep going
0024 0012 045B RT y, return to caller
0025 *
0026 END
NO ERRORS, NO WARNINGS