Hello PIC.ers, YAG (Yet Another Gotcha) Some kind soul solved this for me a while back & all my multibank 16f877 projects - with 4 ram banks each - now incorporate this setup. The cblock 0x71 .. ensures that int. service context save is done on fregs that are common to all the banks. 0x70 should not be used if you want to debug with the ICD. ;bank0 general purpose register definitions NB. for 16f84 this starts @ ;0x0C, for 16f877 or 16c74 it's 0x20 cblock 0x20 m_porta ;mirror of port a m_portb ;mirror of port b . . yada yada da.. . . zzzzzzzz ;just a marker reg., don't over-reach ;freg 0x070 in bank0 if using ICD endc if zzzzzzzz >= 0X070 messg "BANK 0 IS FULL !!" endif cblock 0x71 ;highest 16 bytes common across all banks save_s ;allowing isr context save no matter the bank save_w ; 0x70 is NOT used. Reserved for the ICD. tempW pclath_save endc ;bank1 fregisters cblock 0xA0 ;bank1 fregs start at 0xA0 lcd_obuff lcd_template_index . yada yada da.. >Date: Mon, 25 Jun 2001 13:52:46 -0400 >From: myke predko >Subject: Re: [PIC]: Context saving in ISRs > >Hi Drew, >I don't think anybody else has answered this question. >You are correct "W_TEMP", should be at the same offset for both Banks 0 and 1. > >Not only this, but "STATUS_TEMP" should ALSO be at the same offset for both >Banks 0 and 1. > best regards, John JOTD "If you have spots before your eyes, shouldn't you see a doctor? " "No, only spots." e-mail from the desk of John Sanderson, JS Controls. Snailmail: PO Box 1887, Boksburg 1460, Rep. of South Africa. Tel/fax: Johannesburg 893 4154 Cellphone no: 082 741 6275 email: jsand@pixie.co.za Manufacturer & purveyor of laboratory force testing apparatus, and related products and services. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics