Hi, I made some changes in my code as a possible simplify it. Now I=B4m needing fast asm routine to divide a 16 bits unsigned number by constant decimal 10 instead 100. Look that I=B4m using a 16F pic series. I tried to do that in below from Scott Dattalo But some 16bits values dosen=B4t work. For exemple: 0x7D0 / D10 =3D 0xC8 - OK 0x9C4 / D10 =3D 0x20 - ERR ;---------------------------------- ;divby10 ;Divides the unsigned integer N_hi:N_lo by the constant 10. ; ;Input ; N_lo - Low byte of the 16 bit dividend ; N_hi - High " " ;Output ; R_lo - Low byte of the result ; R_hi - High " " ; ; 14 words ; 149 cycles divby10_ver3: CLRF R_lo ;Only need to clear R_lo. R_hi is cleared by = shifting(below) MOVLW 13 MOVWF count ; v3_1: MOVLW 0xa0 ;If the high byte is greater than or equal to 0xa0, SUBWF N_hi,W ;then this subtraction causes no borrow (i.e.C=3D1) SKPNC MOVWF N_hi ;Replace N_hi with N_hi - 0xa0 if RLF R_lo,F ;Shift result left one bit and RLF R_hi,F ; pick up the carry bit in the process. RLF N_lo,F ;Adjust N for the next iteration. RLF N_hi,F DECFSZ count,F goto v3_1 RETURN Any help Best regards Luis F. -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist