On Fri, 30 May 2003, Tan Chun Chiek wrote: > 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 find it quite coincidental that 55 base 16 is 85 base 10 and that 35 base 16 is 53 base 10. This is almost as strange as -40 degrees Fahrenheit is -40 degrees Celsius! Do you see the problem now? You're viewing the numbers in the wrong base. Scott -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body