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


Forums > C64 Coding > TIL: The instruction after SEI can be executed before a pending IRQ is handled
2017-11-07 15:56
Krill

Registered: Apr 2002
Posts: 2825
TIL: The instruction after SEI can be executed before a pending IRQ is handled

As described here: http://visual6502.org/wiki/index.php?title=6502_Timing_of_Inter..

I never knew this, after all those years, and thought i'd share this as a heads-up.

Thanks to Bubis for pointing it out to me!
 
... 89 posts hidden. Click here to view all posts....
 
2017-11-11 12:26
Oswald

Registered: Apr 2002
Posts: 5017
anyhow I have real machine experience when I've been setting up raster irq without acking timer interrupt for ages, and then at a case it refused working, and I wondered how could I forget to set it up correctly. Since then I religiously ack it.
2017-11-11 13:23
chatGPZ

Registered: Dec 2001
Posts: 11100
Quote:
An IRQ may destroy A while you try to lda #$7f sta $dc0d

in that case you have much bigger problems than anything discussed here
2017-11-11 16:23
Krill

Registered: Apr 2002
Posts: 2825
And we are discussing interrupt setup when run from a plain BASIC environment. So disabling CIA1 interrupts is enough, no SEI/CLI required. Period. :)
2017-11-11 16:29
chatGPZ

Registered: Dec 2001
Posts: 11100
even in most other scenarios... eg in a trackmo you pretty much want to always do it at a very defined point to avoid glitches - and then you exactly know what happens anyway, and dont need sei/cli at all. you DO need them only when you do brute force AEG style linking =)
2017-11-11 21:05
Frantic

Registered: Mar 2003
Posts: 1627
Okay. I'll always try to make sure to remember to use SEI/CLI then.
2017-11-11 21:06
Frantic

Registered: Mar 2003
Posts: 1627
Ha ha
2017-11-12 03:49
Oswald

Registered: Apr 2002
Posts: 5017
"and then you exactly know what happens anyway"

yeah, until you dont and start having bugs, which is always the case.

Suprised by Gunnar's hatred towards doing it the >right< way, having seen his overly pedantic sources. As a rule of thumb you dont want to rely on things being in a certain state when programming.
2017-11-12 08:27
Krill

Registered: Apr 2002
Posts: 2825
Quoting Oswald
hatred towards doing it the >right< way, having seen his overly pedantic sources.
"Hatred" is too strong a word in this context, and the flip side of pedantry is that unnecessary bytes also cause that certain itch. :)
And as for "right", again, either you come from BASIC, in which case there only is CIA1 interrupt to worry about, or you don't, in which case all bets are off and you're doing whatever specific stuff needs doing, with or without SEI/CLI.
2017-11-12 08:46
Krill

Registered: Apr 2002
Posts: 2825
Oh, and when assuming that some people run demos from a BASIC environment with all kinds of interrupts enabled, you can still disable all of them without SEI/CLI.
Unless its a truly hostile environment with interrupt handlers destroying register contents and setting up other interrupts, etc., as you describe, thenÂ… i dunno, the people running those don't deserve a demo treat. :)
2017-11-12 12:05
Copyfault

Registered: Dec 2001
Posts: 466
I think Oswald is basically right here as he's just applying Murphy's Law to the coding of IRQs and their setups.

Then again, once you start optimizing (which is what C64 demo coding is all, no?) it's absolutely right to track down every unnecessary byte or cycle - even if it "feels odd" at first. Have also been using SEI/CLI ever since but I'm really happy and thankful to be enlightened by this discussion.

Just my 2c...
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 - 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
RadMan/TSM
Guests online: 62
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.9)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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