David BALDWIN wrote: > sublw .3 > >and it is not working properly. When I am replacing it with addlw 0xFD, >everything is working! I though the assembler was translating a sublw >into the right addlw?! Is it the same opcode? sublw .3 does: 3 - w addlw h'fd' does: h'fd' + w = - 3 + w = w - 3 BTW this is a very handy trick to reverse the subtraction order. > > call EEREAD > btfsc w,2 <- Illegal. Can't test bits in w. > goto OK This is actually testing the register pointed to by the FSR register > call EEREAD > btfsc EEREAD,2 <- ?? EEREAD is a label in your program. > goto OK The register actually being tested depends on the address of EEREAD. -- Bob Fehrenbach Wauwatosa, WI bfehrenb@execpc.com