piclist 1996\04\10\132120a >
Thread: What is MPASM error code 302
face BY : John Payson email (remove spam text)

> >    movlw     TRISB
> >    movwf     FSR
> >    movlw     .0     ; Note that 0 bits are required for output
> >    movwf     INDF
> >
> > It's the same number of instructions but I find it slightly more
> > straight- forward personally.
>     Byron:
>     Yes, that will work perfectly.  Keep in mind that, although it's
>     no longer than the bank-switching code FOR ACCESSING ONE
>     REGISTER, it's much less efficient for cases that require
>     multiple register accesses.

While in most cases it makes more sense to use direct addressing with RP0
set/unset as appropriate, indirect addressing can be useful when rapidly
accessing registers in both banks.  For example, if you need rapidly and
repeatedly set TRISB and PORTB, it may make sense to point FSR to TRISB, so
that it may be accessed without any intermediate accesses to RP0.  This
technique can pay off especially well when trying to rapidly read the EEPROM
on a 16C84 [point FSR to EECTRL1].

In reply to: <m0u6rjY-000BdXC@mailbox.mcs.com> from "Andrew Warren" at Apr 9, 96 08:19:33 pm
See also: www.piclist.com/techref/language/index.htm?key=asm
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) What is MPASM error code 302

month overview.

new search...