Perfect!!! thanks a lot!!! Gonzalo ----- Mensaje original ----- De: "M. Adam Davis" Para: Enviado: Jueves 4 de Enero de 2001 4:39 PM Asunto: Re: [PIC]: Not use the address but what is inside that address | As noted in my previous message you could use the routine from the | piclist.com faq: | http://www.piclist.com/techref/microchip/math/bit/mask.htm | | ; Convert 3-bit number (0-7) in INDEX to a 8-bit mask (00000001 ... | ; 10000000) in BitP. | movfw INDEX | andlw b'00000011' ;Start with half of the mask. | movwf BitP | incf BitP, W ;The 4-bit converter | btfsc BitP, 1 | iorwf BitP, F | incf BitP, F | btfsc INDEX, 2 ;Is it high 4 bits? | swapf BitP, F | | So you make your number into a mask, then you can apply that mask to the | number from the port. Your value (set or clear) will show up in the | status register, zero bit. | | -Adam | -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.