Olin Lathrop embedinc.com> writes: > > Peter wrote: > > In 'MPLINK Tutorial' (A4E88F11d01) page 24, example 2.6 'MPASM > > limitations' I see that MPLAB cannot switch back and forth to the same > > bank, i.e. code parts belonging to the same bank cannot be interleaved > > with code or data meant for other banks. > > Huh? This makes no sense at all. Are you sure you're not referring to code > sections? Look at that document and see. I will quote it below. This is a fairly serious limitation imho. Is there some workaround ? Almost 10 years ago I wrote code for 16C54 that used a 'handmade' page switching and interleaved code in the 'low page' (<0x100) with code in the 'high page' (>=0x100). I used a variable for each page to keep track of $ when switching pages. Similarly I used a variable to keep track of the registers allocated. Example (untested here!): ORGLOW set 0 ORGHIGH set 0x100 ... ; reset vector org ORGLOW reset: ... ; code here goto reset1 ORGLOW set $ ; reset code continued org ORGHIGH reset1: ... ; etc ORGHIGH set $ ... etc This allowed me to put code that belongs logically together in the same listing page. MPASM does not seem to allow this ? Quote from mplink tutorial follows: snip --- 2.5.5 Linker Script Caveats Some linker script caveats: ... * You cannot, in MPASM, switch back and forth to a section in a single file, e.g., you cannot do this: CODE MY_ROM : (instructions) : UDATA MY_VARS : (variables) : CODE MY_ROM : -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist