Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user lotus_skylight ! (Registered 2024-09-25) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > NMI delay
2024-02-13 22:34
JackAsser

Registered: Jun 2002
Posts: 2014
NMI delay

How much is an NMI delayed if triggered during IRQ-setup?
 
... 45 posts hidden. Click here to view all posts....
 
2024-02-13 22:57
chatGPZ

Registered: Dec 2001
Posts: 11293
start here:

https://web.archive.org/web/20141224041136/http://visual6502.or..

You'll be more confused than before :o)
2024-02-13 22:59
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: start here:

https://web.archive.org/web/20141224041136/http://visual6502.or..

You'll be more confused than before :o)


Haha, already did. Hence the question here. :D
2024-02-13 23:00
chatGPZ

Registered: Dec 2001
Posts: 11293
also
https://web.archive.org/web/20210405071346/http://visual6502.or..
https://web.archive.org/web/20210405071501/http://visual6502.or..
2024-02-13 23:44
Fungus

Registered: Sep 2002
Posts: 668
Ah I see what you mean now, I'm not entirely sure either.
2024-02-14 00:35
Krill

Registered: Apr 2002
Posts: 2940
Quoting JackAsser
Imagine u have a raster IRQ, and when the CPU performs the IRQ-load (i.e. push status, return address, read IRQ vector and jump (7c) ) an NMI occurs. This NMI will get delayed by that IRQ process, but how much at most? In VICE it looks like around 3-4 cycles, but I don't understand why. Why not 7c?
Hazarding a guess, this seems rather analogous to the BA/AEC-goes-low VIC-takes-over-the-bus case (or REU DMA, for that matter).

Up to 3 write cycles (6502/6510 never needs more in a row, with any kind of interrupt being the worst case), then interruption, because it's safe only now.

Wouldn't be surprised if the NMI-on-top-of-IRQ and BA/AEC-low cases share some considerable assumptions, logic and circuitry.
2024-02-14 05:50
Martin Piper

Registered: Nov 2007
Posts: 699
To really get an answer to this the PLA ROM needs to be understood.

http://www.visual6502.org/JSSim/expert.html
https://www.pagetable.com/?p=410
https://www.pagetable.com/?p=39
"At the end of each instruction, the PLA causes the T bitfield to reset, so that the next instruction starts with T1=1 again."
"All interrupt and NMI requests are always delayed until the current instruction is finished, i.e. until T gets reset."
2024-02-14 09:33
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: To really get an answer to this the PLA ROM needs to be understood.

http://www.visual6502.org/JSSim/expert.html
https://www.pagetable.com/?p=410
https://www.pagetable.com/?p=39
"At the end of each instruction, the PLA causes the T bitfield to reset, so that the next instruction starts with T1=1 again."
"All interrupt and NMI requests are always delayed until the current instruction is finished, i.e. until T gets reset."


Given that and given that an IRQ really is a BRK-instruction under the hood we can assume the delay can be up to 7 cycles then?
2024-02-14 13:56
chatGPZ

Registered: Dec 2001
Posts: 11293
If only it was that simple :o)

It might be a good idea to simulate and iterate too all possible timings (ie trigger the nmi in every possible half cycle of that "BRK") and then see what happens. If i understood the wiki correctly, there are still special cases to consider.
2024-02-14 14:09
JackAsser

Registered: Jun 2002
Posts: 2014
Quote: If only it was that simple :o)

It might be a good idea to simulate and iterate too all possible timings (ie trigger the nmi in every possible half cycle of that "BRK") and then see what happens. If i understood the wiki correctly, there are still special cases to consider.


Yeah, someday. For now I simply made sure that my IRQs never collides with the NMIs. :)
2024-02-14 14:18
chatGPZ

Registered: Dec 2001
Posts: 11293
BAH! DO IT! :D
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
insane/Rabenauge
Hagar/The Supply Team
iAN CooG/HVSC
Skate/Plush
Britelite/Dekadence
CA$H/TRiAD
Sentinel/Excess/TREX
Flavioweb/🇮🇹HF..
Guests online: 135
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Wonderland XIV  (9.6)
8 Comaland 100%  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Morph  (9.5)
8 Dawnfall V1.1  (9.5)
9 Onscreen 5k  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.2)
Top Diskmag Editors
1 Magic  (9.8)
2 Jazzcat  (9.5)
3 hedning  (9.4)
4 Elwix  (9.1)
5 Remix  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.055 sec.