view lib/alib/bin2hex.a @ 2765:0bd16cca86b7

Updated rules.mak for all the os9 format's to format the entire disk. People were having some issues with the disk images not being formatted to their full capacity and preventing some functions from working.
author drencor-xeen
date Thu, 17 Jan 2013 11:03:26 -0600
parents 7d70b7e1cb21
children aaba193af04f
line wrap: on
line source

****************************************

* Convert hex byte to 2 hex digits

* OTHER MODULES REQUIRED: none

* ENTRY: B= value to convert

* EXIT: D=2 byte hex digits


 nam Convert Byte to Hex
 ttl Assembler Library Module

 psect BIN2HEX,0,0,0,0,0

BIN2HEX:
 pshs b
 lsrb get msn
 lsrb
 lsrb
 lsrb fall through to convert msn and return
 bsr ToHex
 tfr b,a 1st digit in A
 puls b get lsn
 andb #%00001111 keep msn

ToHex
 addb #'0 convert to ascii
 cmpb #'9
 bls ToHex1
 addb #7 convert plus 9 to A..F
ToHex1
 rts

 endsect