| |
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.... |
| |
Oswald
Registered: Apr 2002 Posts: 5017 |
anyhow I realise this is a religious argument, everyone should just do it as he likes. doesnt really matter. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1370 |
Oswald, 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.
And if you do know about it, you can disable it, in which case an SEI before you disable it will create extra work for you, or an SEI after you disable it will do nothing.
Either way all you are doing is adding extra bytes to your init code with zero improvements to reliability.
It may even cause your raster interrupt to have it's first occurrence on the wrong line altogether, which can occasionally produce a frame of garbage at the start of your routine. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11101 |
Quote:Yes, you'd have to be running code stored in read-sensitive IO registers, at the precise cycle an IRQ is expected. I find it hard to imagine any kind of scenario where that would save you any cycles or memory.
it could be a fun riddle for obfuscation though :) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1370 |
(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...) |
| |
Krill
Registered: Apr 2002 Posts: 2825 |
Quoting Oswaldthis 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. :) |
| |
Oswald
Registered: Apr 2002 Posts: 5017 |
"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. |
| |
Krill
Registered: Apr 2002 Posts: 2825 |
Now you're grasping at straws. |
| |
Oswald
Registered: Apr 2002 Posts: 5017 |
Quote: Now you're grasping at straws.
Now you're trolling. |
| |
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. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11101 |
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 |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 - Next |