piclist 2008\07\07\184838a >
Thread: Code packing
www.piclist.com/techref/microchip/devices.htm?key=pic
face picon face BY : Jinx email (remove spam text)



> movlw (1 << TMR0ON) | (1 << T0PS2) | (1 << T0PS0)
> movwf T0CON
>
> This seems to make the code partially self-documenting, since you
> can see what each bit is without hopping back to the manual or trusting
> the comments. And it's exactly the same opcodes in the hex file too,
> unlike using a pile of BSF/BCFs which take more space and time!

Chris, I'd see that and might briefly wonder what TOPS is. AYS, it's
partially self-documenting. Adding an extra comment like

;Set pre-scale bits to 101 (1:64, = 100kHz IRQ) and turn TMR0 on

would explain further. Mostly it's really helpful when you come back
in 6 months to edit or re-understand your own code


<044b01c8e083$73cad770$89aafea9@ivp1> 7bit

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Code packing

month overview.

new search...