thank's , i will try your code
----------
{Quote hidden}> De : Dmitry Kiryashov <
spam_OUTzewsTakeThisOuT
AHA.RU>
> A :
.....PICLISTKILLspam
@spam@MITVMA.MIT.EDU
> Objet : Re: programmers problem
> Date : samedi 22 août 1998 11:07
>
> Hello Yves.
>
> Seems to be this topic was discussed some time ago so I'll try to
> refresh it briefly. Feel free to ask any clarifying questions.
>
> ; y -> input value in range 0 .. 7 ;
> ; W -> output will mask like 00000001 .. 10000000
>
> movlw 1
> btfsc y,1
> movlw 4
> movwf temp
>
> btfsc y,0
> addwf temp,f
>
> btfsc y,2
> swapf temp,f
>
> movfw temp
> ;
>
> WBR Dmitry.
>
>
> Yves Heilig wrote:
> >
> > Hi,
> > I'm a beginner in programming of PIC, somebody can it come to my help?
> > Here my problem: I want to test the contents of an indexed table of the
> > form flag(Y), Y being a variable
> >
> > Example:
> > The variable Y=2
> > How to test bit 2 of flag ?
> > I thought making :
> >
> > y equ H' 11 '
> > movlw 2
> > movwf y
> > btfss flag, Y
> >
> > this instruction does not give satisfaction because it uses the value
> > litteral of Y (H'11') and not its contents.