mriendeau@vicr.com wrote: > >First, it's unnecessary; the "empty" code-space is ALREADY filled > >with instructions that won't affect program flow. > > Yes, but your program has to wait for the time it takes to execute > the number of (ADDLW ?) instructions, or the WDT timeout if it is > still responding, before the wrap-around. My application .... > needs to respond immediately to a 'glitch' in the program counter. Mike: We're talking about a couple of milliseconds. Surely that's fast enough, especially considering the fact that the program's out of control anyway. > >Second, what will those "reset vectors" look like? Just a bunch of > >GOTOs? > > Yes, that's exactly what they are. > > > How's that going to work on a processor whose code-space is paged? > > Yes, you have a point, but it's a red-herring in the scope of > an already out-of control situtation. That is, your wrap-around will > only produce the same page result. Maybe I'm misunderstanding what you mean here, but I don't think so. If the PC is allowed to execute all the instructions in the "unused" space, it'll eventually wrap around to address 0000, on page 0. > If you have the macro loop detect the first address in an empty > page and put in a bit of code to set the PCLATH register with the > appropriate bits; The GOTO which immediately follows would then > vector off to the appropriate reset address. Not perfect, but it > gives you a better statistical advantage of quickly regaining some > control over the application. Better than what? Again, maybe I'm misunderstanding, but this method would seem to work only if you could put the page-setting instructions at the first location in EVERY page, including those which are completely or partially used by your program. If you were to do that, it would work just fine, but it's not exactly the "use a macro to fill empty space with reset vectors" solution that you originally proposed. Am I missing something, or are you proposing a NEW solution? -Andy Andrew Warren - fastfwd@ix.netcom.com Fast Forward Engineering, Vista, California http://www.geocities.com/SiliconValley/2499