> When using the access bank you do not have to worry about > banks at all. The ISR-temp regs should be in the access > bank, of course. Jan-Erik, I accept your comments. I was trying to illustrate to Josh how the memory addressing works, and as such used some absolute addressing >> In effect BSR works like banksel, > > ??? > Not "works like". BSR is a register and BANKSEL is a MPASM > directive. BANKSEL simply sets the BSR bits Well, I'd hair-split with that a little. 16F BANKSEL sets RP bits in STATUS. 18F MOVLB sets bits in BSR. The intention is achieved "in effect" 16F BANKSEL PORTA => BCF STATUS,0x5 BCF STATUS 0x6 18F BANKSEL LATA => MOVLB 0x0F The thing is, if you happen to set the wrong bank on a 16F you could be altering TRISA, which has the same relative address from the start of the bank as PORTA does. That won't happen on the 18F >> so you would use it to work with the RAM in a particular block. >> There is not the ambiguity though of SFRs sharing addresses in >> different banks >> >> eg (18F) >> >> movlb .1 >> movlw 0x04 >> movwf lata > > No. > > BANKSEL LATA > MOVLW 0x04 > MOVWF LATA Sorry, my fault. Without comments you didn't get what I meant. A better example would be If RAM location 0x004 holds 0x39, and RAM 0x104 holds 0x31 movlb .0 ;RAM block 0x000 - 0x0ff movfw 0x104 movwf lata LATA = 0x39 movlb .1 ;RAM block 0x100 - 0x1ff movfw 0x104 movwf lata LATA = 0x31 Not particularly elegant code, I appreciate that. In that example it does show that banking is effected for getting to the source > But, since LATA is in the access bank, that isn't needed. LATA > can *always* be accessed no matter the current BSR setting That was I intended to say, but my explanation fell short >> 'banksel' the pseudo-op isn't applicable on the 18F. > > Of course it is I haven't used banksel very much at all on the 18F, and unfortunately overlooked it. A terrible gaffe on my part banksel source movfw banksel target movwf is a legitimate sequence > SFRs don't co-exist with GPRs in a block like they do on a 16F, > > Yes they do ! Well, I did mention an exception > I'd seriously advice anyone interesting in the PIC18 to read up on > the architecture themselfs Agreed. 16F architecture has more differences than similarities when compared with 18F, and I did make a bit of a dog's dinner trying to show that ;-) wbr -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist