Again, NMI\ is
not level-sensitive. It is edge-sensitive. If the line was low during reset, and it is still low when the reset line comes up and while the processor goes through the reset sequence, it will not see a high-to-low transition, so it will not respond to NMI\ being low.
What I don't know is how many cycles the processor would have to have progressed through the reset sequence before it will detect a high-to-low transition on NMI\. Maybe it will only accept it in the last 20ns of the last cycle, and anything before that would be ignored. It would be much easier to experiment with the CMOS 6502 since you can stop the clock, single-cycle it manually with $2 in parts in a home-made breadboard and look at every address, data, and control line with a logic probe which could be as simple as an LED and 1K resistor. The NMOS 6502 cannot be stopped however. This experiment will only work with the CMOS 6502.
Quote:
After 15th clock cycle, NMI' ISR is complete and returns back to $F800 and the first instruction at $F800 resumes.
If indeed the processor will even see the NMI\ high-to-low transition before first instruction, the 15th cycle will be the
beginning of the ISR. Even if the ISR only consists of an RTI instruction and does nothing else, it will not get back to the main program until at least cycle 21.
Quote:
$F800 is the main program to initialize A, X, Y, and stack register before normal program starts.
There is no need to initialize A, X, and Y, as each part of the program will do whatever initializing it needs to do, if any, since it cannot assume the initial values are anything meaningful unless you are passing parameters via these registers. The things the reset routine normally does are:
CLD (not necessary on CMOS 6502)
Initialize the stack pointer
Set up the I/O
Set up interrupt sources
Initialize system flags, variables, arrays, etc. in RAM
etc.
Much of this can be done in a higher-level language after only a few instructions in assembly