Added the PIC tag. I remembered running this snippet few days ago and the result wasn't anything like that. Did you copy the source from the PDF? Have you tried the source from the ZIP file accompanying the AN? Tan CC ----- Original Message ----- From: "Morgenbrise Ent. Co., Ltd." To: Sent: Friday, May 30, 2003 11:36 AM Subject: Binary to BCD conversion As a novice, I studied the "AN-526". Tried to run the program "Appendix H: Binary (16bit) to BCD". However, the result in R0, R1, R2 become 06,85,53 in stead of 06,55,35 when converting the number B'11111111' in both H_byte & L_byte. I traced every step but can't find where is the problem? Not yet understand the algorithm of such a conversion, my first step is to follow the codes; even so the result is not correct. The sample routine was publilshed many years ago, there must be many people ever study it. I would appreciate if someone hints me the blind point(s) where I stuck? Regards Paul Tsai -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body