Good day to all. I had asked about a technique to divide a 6 digit packed BCD number by 2. I've had a good look at it now and learned a couple of things: I don't need to separate the packed BCD digits and I don't need to decrement the next higher digit if it is odd since I lose the LSB when I right shift. My first pass at code follows: F1_TIME_1, 2, 3 contain the number to be divided /2 R1_TIME_1, 2, 3 contains the result rrf F1_TIME_1,W ;/2 andlw b'00000111' ;lower nib only btfsc F1_TIME_1,4 ;is nxt nyb odd? addlw 5 ;add 5 to lower nyb movwf R1_TIME_1 ; rrf F1_TIME1,W ;/2 andlw b'01110000' ;upper nib only btfsc F2_TIME_1,0 ;is nxt nyb odd? addlw 0x50 ;add 5 to upper nyb iorwf R1_TIME_1,F ;upper nyb known to 0 Any thoughts? dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 17 years of Engineering Innovation (1984 - 2001) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu