Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums

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

Registered: Apr 2002
Posts: 930
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 11:40

Registered: Aug 2004
Posts: 746
(actually scratch that "it may even" para from the end of my last comment, I didn't quite think that one through - if a CIA interrupt goes off during setup unacknowledged, the consequences are going be considerably worse than a single frame...)
2017-11-11 11:45

Registered: Apr 2002
Posts: 930
Quoting Oswald
this is a religious argument
This may be an academic discussion (unless you need the size, 4K and all), but it's certainly nothing to do with religion. Well, unless you are a cargo cultist. :)
2017-11-11 11:56

Registered: Apr 2002
Posts: 4175
"Either way all you are doing is adding extra bytes to your init code with zero improvements to reliability."

An IRQ may destroy A while you try to lda #$7f sta $dc0d. another irq from the other CIA may re-enable $dc0d. You may have interrupt sources from VICII too, fucking you up in all sorts of ways. (rewriting fffe/f after you've set them up for example).

"if there's a source you don't know about to disable, you're going to have bugs regardless of whether you SEI/CLI or not, as it's going to hit while your code isn't expecting it."

you may just forget about your super size effective irq setup and it will backfire when you least expect it.
2017-11-11 12:34

Registered: Apr 2002
Posts: 930
Now you're grasping at straws.
2017-11-11 13:06

Registered: Apr 2002
Posts: 4175
Quote: Now you're grasping at straws.

Now you're trolling.
2017-11-11 13:26

Registered: Apr 2002
Posts: 4175
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 14:23

Registered: Dec 2001
Posts: 8407
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 17:23

Registered: Apr 2002
Posts: 930
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 17:29

Registered: Dec 2001
Posts: 8407
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 22:05

Registered: Mar 2003
Posts: 1330
Okay. I'll always try to make sure to remember to use SEI/CLI then.
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
Users Online
Klegg/Panda Design
Guests online: 50
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 The Shores of Reflec..  (9.6)
5 Comaland 100%  (9.6)
6 Lunatico  (9.6)
7 Incoherent Nightmare  (9.5)
8 Wonderland XII  (9.5)
9 Comaland  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 Pandemoniac Part 2 o..  (9.5)
2 Dawnfall V1.1  (9.5)
3 Daah, Those Acid Pil..  (9.5)
4 Synthesis  (9.5)
5 Treu Love [reu]  (9.5)
6 FMX Music Demo  (9.4)
7 Dawnfall  (9.4)
8 Merry Xmas 2017  (9.4)
9 Hardware Accelerated..  (9.3)
10 Tribute to Bob Wakelin  (9.3)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Finnish Gold  (9.3)
Top Coders
1 Axis  (9.8)
2 Crossbow  (9.8)
3 Graham  (9.8)
4 HCL  (9.8)
5 Lft  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.704 sec.