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



> movlw (1 << TMR0ON) | (1 << T0PS2) | (1 << T0PS0)
> movwf T0CON

This is definitely better than just providing a HEX or even binary value,
but I still don't like it much because the mnemonics can be cryptic and
because:

1 - The mnemonics can by cryptic, so you still have to look them up in the
manual most of the time.

2 - Because of how continuation lines are broken in MPASM, you don't get the
opportunity to comment on each bit.

3 - This only shows the bits that are set to 1, not 0.  The choices you made
that happened to be the default value are not shown.

I document each field, for example:

        dbankif adcon1
        movlw   b'00001000'
                ; XX------  unimplemented
                ; --0-----  use Vss for Vref-
                ; ---0----  use Vdd for Vref+
                ; ----1000  configure AN0-AN6 as analog, rest digital
        movwf   adcon1


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.
<001801c8e074$6fc7c390$0300a8c0@main> 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...