I just started fiddling with a PIC 12F629 and was curious as to which way is best to send data out the GPIO,0 ( pin 7 ) that is stored in say W_TEMP. Right now I'm clearing the C bit in OPTION_REG and rotating the LSB on W_TEMP and then rotate C into GPIO. This seems messy...
I'm confused with your request. "OPTION,0" is used for pre-escaler settings when using internal timer0.
You are willing to "clearing the C bit in OPTION_REG ", but in your code you are clearing the bit 0 of the OPTION register. Your code should read "bcf STATUS,0" instead.
Also you should verify if the port is correctly configured as you wish. As this is a multi-purpose communication port, by default bits <2:0> are not defined as logical I/O but as internal comparators. You should force the I/O behaviour for these bits by doing
One question, and it might just be something I missed, the $+/-<Literal> jumps instructions? This would really be the same as setting multiple labels, just cleans up the code a bit, visually speaking. Or is there something else to it?
When writing a program, it is best to use labels. Quite often it is hard to think up an intelligent label, so just use AA AB AC etc. The when the program is complete, you can replace the labels with $+4 $-6 etc.
But it is easier to see where the program is jumping to when you use labels during the design process.
It is also best to use labels as this allows you to add extra lines of code without having to change an instruction such as: goto $-15.
When writing a program, it is best to use labels. Quite often it is hard to think up an intelligent label, so just use AA AB AC etc. The when the program is complete, you can replace the labels with $+4 $-6 etc.
I can't see why you would replace the labels at all. If the program is complete, and you never edit it again, why bother? If you do go back to it ever again, relative jumps are a pain. If you want to obfuscate the code, keep it to yourself and only send out the hex code.
The only times that I have seen them used usefully is in macros where some assemblers can't handle jumps to labels, and in very short jumps of $-1, $, or $+1 where they just become shorthand for previous line, this line, and next line.