I am going through the EPE - PIC TO MOUSE DEMO (epemag.com/datafils/pic2kandm.zip) for a project that I am working on. I am trying to convert the code over to a 16F877A chip and have the PIC output a signal to a DAC. Basicly I want to have the mouse movements input into the PIC have the PIC send a signal to a DAC which will output to pots.
So now I have been going through the code trying to understand what it is doing. As you can tell I am an assembly newb so that is why I am asking for some help.
Here is the snippet of code that has propted me to ask for help:
Code:
WAITSTARTBIT:
comf PORTA, W
andlw %00000011
btfss STATUS, Z
goto WAITSTARTBIT
I understand what comf, andlw and btfss does from but I have been unable to determine how and in what way comf/andlw affect the Z bit of STATUS. I see that this code is waiting to see if Z bit is equal to 1 so that it can skip the next instruction.
My question is...
What will cause the Z bit to go to one?
If someone wants they could even give a more indepth lesson the the Z bit of status and if anyone is willing to teach me or want to help me code this portion of my personal project they are always welcome! ;-)
Thank you