It has to be less than 8. The value in W represents the bit number that t= he mask is generated for... 0 =3D 00000001 1 =3D 00000010 2 =3D 00000100 3 =3D 00001000 ... 7 =3D 10000000 see http://www.piclist.com/techref/microchip/tables.htm But a better solution is at http://www.piclist.com/techref/microchip/math/bit/mask.htm as I indicated earlier. --- James Newton (PICList Admin #3) mailto:jamesnewton@piclist.com 1-619-652-0593 PIC/PICList FAQ: http://www.piclist.com or .org -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Gonzalo Jim=E9nez Yamasaki Sent: Friday, May 04, 2001 15:44 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]:a newbie mpasm question I get a litlle bit confuse with that, if you want to use it, you MUST= be sure that "GetMask" is in a PCL lower than 248... otherwise if PCL =3D 25= 0, and w =3D 7 after ADD PCL =3D 2. Am I wrong? Regards, Gonzalo ----- Mensaje original ----- De: "Michael Rigby-Jones" Para: Enviado: Viernes, 04 de Mayo de 2001 08:00 Asunto: Re: [PIC]:a newbie mpasm question | GetMask: | addwf PCL,f | retlw B'00000001' | retlw B'00000010' | retlw B'00000100' | retlw B'00001000' | retlw B'00010000' | retlw B'00100000' | retlw B'01000000' | retlw B'10000000' -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.