>A notice only >Considering long BCD numbers that was DAA or DAW developed for, the carr= y never is set when you add two proper BCD numbers. >(99 + 99 =3D 198). I had to be blind or drunken not knowing about it :-). The previous sente= nce isn't true of course. Igor -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Bob Ammerman Sent: 7. =FAnora 2003 13:32 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: DAW how it works (BCD) I am pretty sure you are going to have to 'or' the carry from the ADDWFC with the one from the DAW. You're second text case added 0x70 to 0x70 and then DAW'd The ADDWFC should _NOT_ generate a carry (contrary to the information in your attachment). 0x70 + 0x70 =3D 0xE0 with _NO_ carry. Then the DAW should fix it up to: 0x40 with a carry. You need that carry into the next byte. What a stupid way to design the DAW instruction. It should have set carry= as needed, but never cleared it. This really screws up the performance of my macro, that is for sure. Here is the best I have come up with for saving and merging carry. ADDWFC var,x ; add two bytes RRCF temp,f ; remember the carry DAW ; adjust the value BTFSC temp,7 ; was carrry set? SETC ; yes: set it again Bob Ammerman RAm Systems -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.