James Newton wrote: Richard Ottosen wrote: > Is this what you want? > > noznibs > SWAPF BufTyp,W > ANDWF BufType,W > BTFSC status,Z > RET > > See, hardware guys can write code. :-) Yeah, I suppose that's true... But the real question is whether they can write code that WORKS. The code should return if either the low or the high nibble of BufTyp is equal to 0, right? In other words, we should return if BufTyp = 0xA0, and we should NOT return if BufTyp = 0xA5. Let's try 0xA0 first: BufTyp = 1010 0000: SWAPF BufTyp,W ;BufTyp = 1010 0000, W = 0000 1010 ANDWF BufTyp,W ;BufTyp = 1010 0000, W = 0000 0000 BTFSC status,Z ;this branch is NOT taken, RET so we return. That one works fine, so let's try 0xA5... BufTyp = 1010 0101: SWAPF BufTyp,W ;BufTyp = 1010 0101, W = 0101 1010 ANDWF BufTyp,W ;BufTyp = 1010 0101, W = 0000 0000 BTFSC status,Z ;this branch is NOT taken, RET ;and we return. Oops. -Andy === Andrew Warren --- aiw@cypress.com === Staff Systems Engineer, IPD === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics