Well, I wrote this code just yesterday, so it isn't tested yet, but I think it must run fine. Any comments? ; Rutina para division. ; Divide c = a / b donde: ; | | +--- 16 bits (b1,b0) ; | +------- 32 bits (a3 a2 a1 a0) ; +----------- 32 bits (c3 c2 c1 c0) ; Utiliza dos variables intermedias de 8 bits: aux y cont ; y una de 16 bits: d (d1 d0) ; movlw 32h ; Inicializa cont movwf cont ; (32 bits) ; buc bcf STATUS,C ; Carry = 0; ; rlf a0,F rlf a1,F rlf a2,F rlf a3,F rlf d0,F rlf d1,F ; movf b0,W ; ? d >= a ? subwf d0,W movf b1,W btfss STATUS,C incf b1,W subwf d1,W btfss STATUS,C goto sigue ; No. Salta a sigue ; movf b0,W ; Si. d <- d - b; subwf d0,F movf b1,W btfss STATUS,C incf b1,W subwf d1,F bsf STATUS,C ; Carry <- 1; ; sigue rlf c0,F rlf c1,F rlf c2,F rlf c3,F decfsz cont,F goto buc ; fin -----Mensaje original----- De: Manuel Castro Caamano [SMTP:manuel.castro@MX3.REDESTB.ES] Enviado el: miercoles 18 de marzo de 1998 11:28 Para: PICLIST@MITVMA.MIT.EDU Asunto: ?32 bits generic division? First many tnx to all who reply my last question about 32 bit to bcd convert. (Mike Keitz, Ron Kreymborg, Bob Fehrenbach, etc...) Now, i must to divide my 32 bits binary by a 16 bits binary number, with no decimals, ?does anyone know the faster routines to do this? Investimento e Investigacisn Industrial, S.L. Av. Galicia 51-53 32300 Barco de Valdeorras (Orense) Spain TLF. : (+34)(9) 88 327370 FAX : (+34)(9) 88 327338 E-MAIL: manuel.castro@mx3.redestb.es