Luis A. Loeff wrote: > I am not being able to explain why a snippet of code fails > permanently. May be somebody can explain > > > 0121 234D 00386 TONESTOP CALL READ80 > 0122 0782 00387 ADDWF PCL, F > 0123 2A71 00388 GOTO REFI > 0124 080F 00389 MOVF BREG, W > .... > > I am positive that the problem has to do with computed goto's > using addwf pcl, f because the following code solved the problem > immediately > > tonestop call read80 > movwf aux1 ; NEW > btfss aux1, 0 ; NEW > goto refi > movf breg, w > .... > > Page boundaries don't seem to be the problem as the original code > was at addresses 0121 through 012A Luis: If W is always guaranteed to be either 0 or 1 after the CALL, then page boundaries clearly ARE the problem; there's no other explanation, especially since interrupts can't be happening. If you don't want to use the "aux1" register, you can do: CALL READ80 XORLW 0 BZ REFI MOVF BREG,W -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads