home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
compuserve
/
Basic
/
PCCHAS.ZIP
/
EXAMPLE1.ASM
next >
Wrap
Assembly Source File
|
1995-01-08
|
798b
|
27 lines
TITL 'Binary To ASCII Hex Conversion Routine'
IDT 'BINHEX'
RORG
DEF BINHEX
REF HEXTXT
*
* IN : R0 Number to be converted
* R1 Buffer to store number in
*
* OUT : R0 Destroyed
* R1 Pointer to end of stored number
* R2 Destroyed
* R3 Destroyed
*
* REF : HEXTXT string
*
BINHEX LI R2,4 4 digits required
LOOP MOV R0,R3 copy value
SRL R3,12 move digit to lsb & zero fill the rest
MOVB @HEXTXT(R3),*R1+ store the ascii character for it
SLA R0,4 position next digit
DEC R2 done all of the digits ?
JNE LOOP n, keep going
RT y, return to caller
*
END