gnupic: pic16 wrong bank selection in sdcc 2.5 ?
Subject:
pic16 wrong bank selection in sdcc 2.5 ?
From:
Rick Bronson ####@####.####
Date:
26 Jan 2006 19:38:39 +0000
Message-Id: <E1F2Cwy-0001U9-00@amazonia>
Hello,
Just wondered if this problem has been addressed:
If I do (PR2 is in bank 1 at address 0x92):
Transmit_byte(PR2);
I get:
;#CSRC test.c 188
; Transmit_byte(PR2);
0004b8 0812 movf 0x12, w MOVF _PR2,W
0004b9 24d1 call 0x4d1 CALL _Transmit_byte
This is wrong, it needs to select a different bank before doing the
"movf". It works if I do:
i = PR2;
Transmit_byte(i);
; i = PR2;
0004b8 1683 bsf 0x3, 0x5 BSF STATUS,5
0004b9 0812 movf 0x12, w MOVF _PR2,W
0004ba 1283 bcf 0x3, 0x5 BANKSEL _i
0004bb 1303 bcf 0x3, 0x6
0004bc 00a5 movwf 0x25 MOVWF _i
;#CSRC test.c 189
; Transmit_byte(i);
Thanks for any help.
Rick Bronson
_
| |
/ /__
.----------------------------------------------------------._____/ (___)
| Rick Bronson ####@####.#### Tel 541-485-7264 | (___)
| Amazonia Computing http://www.efn.org/~rick __ o |_____ (___)
| 5050 Donald Street "Onde esta dinheiro?" _`\<, | \_(___)
| Eugene, OR 97405 -- Gal Costa __( )/( )__ |
`----------------------------------------------------------'