1

I'm working with PIC16F18855 and have some problem with select memory bank via BANKSEL. In listing I see strange message and it's not working properly.

0000   0020           00030         BANKSEL PORTA       
0001   018C           00031         CLRF    PORTA         
0002   0020           00032         BANKSEL LATA        
0003   0196           00033         CLRF    LATA           
                      00034 
0004   003E           00035         BANKSEL ANSELA
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
0005   01B8           00036         CLRF ANSELA
                      00037 
0006   0020           00038         BANKSEL TRISA       
0007   30FF           00039         MOVLW   B'11111111'   
0008   0091           00040         MOVWF   TRISA         
                      00041                            
0009   30FF           00042         MOVLW B'11111111'

ANSELA is a part of BANK 30/ This code I took from Datasheet for PIC16F18855. I've used MPASM 5.87.

Sombody knows whats the problem?

xboborx
  • 17
  • 5

2 Answers2

1

It is a warning, not an error message. I am getting a bunch messages like this. It does not affect compilation, you may ignore it.

user263983
  • 1,599
  • 1
  • 4
  • 9
1

The posts from jwh20 and user263983 are the short answer.

The long answer is that MPASM v5.87 is a primitive and stupid assembler that does not track the bank selected. This assembler reports a warning diagnostic for every RAM address that has any non-zero bits outside of the address bit field for the opcode in the statement.

These not in bank zero messages can be suppressed using the statement:

    errorlevel  -302        ; Suppress the not in bank 0 warning message
Dan1138
  • 1,294
  • 7
  • 15