| |
oleoleo2 Account closed
Registered: Oct 2008 Posts: 21 |
Simple interrupt question.
HI Guys.
I am new to programming in assembler/machinecode on the c64. I have a simple question about the registers $DC0D and $DD0D. I can see in a lot of small programming-examples that they're set to the value $#7F (= 01111111), but none with deep explanations. I found this:
DC0D
CIA Interrupt Control Register (Read IRQs/Write Mask)
7 IRQ Flag (1 = IRQ Occurred) / Set-Clear Flag
4 FLAG1 IRQ (Cassette Read / Serial Bus SRQ Input)
3 Serial Port Interrupt
2 Time-of-Day Clock Alarm Interrupt
1 Timer B Interrupt
0 Timer A Interrupt
'Masking' would say that you define what the computer should look at what to not to look at right? The example where I have seen $DC0D is set to $#7F is where the raster-interrupt routine is used. Does the = 1 mean that bit 0-4 is not used and if that is so, then why is the bits 'inverted'? I guess the bit 0-4 is what we not wan't when using raster-interrupt?
|
|
... 10 posts hidden. Click here to view all posts.... |
| |
oleoleo2 Account closed
Registered: Oct 2008 Posts: 21 |
Quote: If the IRQ mask was designed without set/clear bit, you would have to do something like this to set/clear an IRQ:
LDA $DC0D
ORA #??
STA $DC0D
or
LDA $DC0D
AND #??
STA $DC0D
This has two disadvantages: You need to read the IRQ mask (which is not directly possible on the CIA because reading accesses the flags not the mask) and the setting/clearing is no atomic operation so it's not IRQ save.
Yes but it should be possible anyway with mutual exclusion, and to enable/disable interrupts at the right moments. It would complexify the programs a little bit though. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Yes but it should be possible anyway with mutual exclusion, and to enable/disable interrupts at the right moments. It would complexify the programs a little bit though.
Mind you, that it would be possible for IRQs using SEI/CLI ($dcxx), but not for NMIs ($ddxx). |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Also there are applications where the added possible IRQ latency is no option. And ofcourse the CIA had to be good enough for those too.
|
| |
oleoleo2 Account closed
Registered: Oct 2008 Posts: 21 |
Yeah, but if the IRQ mask was designed in a different way, the processor was probably too, and the applications would have been made to fit the system (I think though this should be in under another topic don't you? :).. |
Previous - 1 | 2 - Next |