>Hmm, surely this can't work for goto's and calls can it? The assembler >dosen't (AFAIK) follow the flow of the code so it can't know if any >particular bit of code has already had the banks bits set before a branch >somewhere else in the program, or am I missing something obvious (as usual). You are correct, but have gone somewhat further in the process than the discussion had. If you use Olin's macros then at each global call the assembler banking assumptions get invalidated, and so the dbankif macro puts code in to be failsafe. However if you are aware that a certain bank will always be selected on entry, then the invalidation can be over-ridden. It is worth downloading Olin's code development suite and having a pass through it to see just how it works. I do not claim it is a panacea for all woes, but it certainly helps to protect against the loop that Jinx has just been through. You may decide to not use it as it stands, but it will certainly give some useful tips. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads