Searching \ for 'Automatic register-bank handling (was: "Re: PIC St' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/memory.htm?key=bank
Search entire site for: 'Automatic register-bank handling (was: "Re: PIC St'.

Truncated match.
PICList Thread
'Automatic register-bank handling (was: "Re: PIC St'
2000\01\28@122225 by Andrew Warren

face
flavicon
face
Jason Harper <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> It appears that the PIC assembers' handling of register banks simply
> sucks - the problems you're having (but not every such problem) could
> have easily been detected by a simple data flow analysis pass in the
> assembler.

Jason:

Unfortunately, an assembler that could catch SOME bank-selection
problems -- or even "almost all" such problems -- would have only
marginal utility.

Unless the assembler were guaranteed to catch ALL bank-selection
errors, users would be unable to trust that it was working and would
STILL have to take manual steps to ensure that their register
accesses were happening properly.

I mean... I guess I can see that it might be useful to have an
assembler that'd catch the really stupid mistakes like:

   MOVLW   00000000B
   MOVWF   PORTA
   MOVWF   TRISA

but those can usually be found by leaving all the EXISTING assembler
warnings turned on and writing macros for other-than-bank-0 register
accesses.

As I've said before, I don't think I'd trust an assembler to catch
register-bank errors unless it could correctly flag the "CLRF TRISA"
in the following (highly contrived) bit of code as an error:

      BCF     STATUS,RP0
      CLRF    PORTA

      MOVLW   PCL+1
      MOVWF   FSR
      DECF    FSR

      DECF    FSR,W
      ADDWF   INDF

      NOP
      NOP

      BSF     STATUS,RP0
      CLRF    TRISA

-Andy


=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...