What is $60 for?

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
unseenmenace
Atari God
Atari God
Posts: 1961
Joined: Tue Sep 21, 2004 9:33 pm
Location: Margate, Kent, UK
Contact:

What is $60 for?

Postby unseenmenace » Mon Mar 07, 2005 9:20 am

Can anyone shed some light on the purpose of the vector at $60. ST Internals lists it purely as "Spurious Interrupt"??? I am trying to modify some Sidsound Designer replay code so that I can perform disk access without crashing the system and it plays with this vector for some reason.
UNSEEN MENACE
Several STFM's, 4MB STE, 2MB TT with 1.2GB Hard Drive and 14MB Falcon with 540MB Hard Drive,
Lynx 2 and Jaguar with JagCD
Member of GamebaseST and AtariLegend team
Check out my website at http://unseenmenace.110mb.com

User avatar
Nyh
Atari God
Atari God
Posts: 1496
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: What is $60 for?

Postby Nyh » Mon Mar 07, 2005 10:38 am

unseenmenace wrote:Can anyone shed some light on the purpose of the vector at $60. ST Internals lists it purely as "Spurious Interrupt"??? I am trying to modify some Sidsound Designer replay code so that I can perform disk access without crashing the system and it plays with this vector for some reason.


The spurious interrupt vector is called when the 68000 gets a vectorred iterrupt signal (like from the MFP) and then doesn't get the number of the interrupt vector ($0 - $FF) on the databus (i.e. no DTACK recieved). I don't know whether you can generate spurious inrterrupts on a ST. I can not remember I ever had one. And I never used it, that's for sure.

Nyh

User avatar
leonard
Moderator
Moderator
Posts: 658
Joined: Thu May 23, 2002 10:48 pm
Contact:

Postby leonard » Mon Mar 07, 2005 10:55 am

Don't know how to produce that exeption too.

but be warned, some demos ( I remember M-Coder music disk) uses $60 for timerB if I remember well. After looking at the code, you can change the MFP base adress so timerB ( generally at $120 is mapped to other location). Maybe your SID player itialise MFP in a way the vectors are not at the "standard" adresses.
( this is a really nice trick to get some bytes of memory, you can put your code at $100 and use timerB :-) )
Leonard/OXYGENE.

User avatar
unseenmenace
Atari God
Atari God
Posts: 1961
Joined: Tue Sep 21, 2004 9:33 pm
Location: Margate, Kent, UK
Contact:

Postby unseenmenace » Mon Mar 07, 2005 11:57 am

Thanks for the info guys

Leonard wrote:be warned, some demos ( I remember M-Coder music disk) uses $60 for timerB if I remember well. After looking at the code, you can change the MFP base adress so timerB ( generally at $120 is mapped to other location). Maybe your SID player itialise MFP in a way the vectors are not at the "standard" adresses.

I don't think its that as the replay code sets up Timers A, C and D using the usual vectors and my program uses Timer B quite happily at the same time.
UNSEEN MENACE
Several STFM's, 4MB STE, 2MB TT with 1.2GB Hard Drive and 14MB Falcon with 540MB Hard Drive,
Lynx 2 and Jaguar with JagCD
Member of GamebaseST and AtariLegend team
Check out my website at http://unseenmenace.110mb.com

gwEm
Captain Atari
Captain Atari
Posts: 220
Joined: Tue Jun 08, 2004 4:43 pm
Location: London, UK
Contact:

Postby gwEm » Tue Mar 08, 2005 2:07 pm

spurious interrupt eh?

actually it is absolutely possible to generate a spurious interrupt on atari ST, especially when using a SID sound routine... as i found out many times... in this case you get a crash with bombs after a random period of time.

simply redirect the vector to a dummy rte to fix these problems.

this spurious interupt seems to occur when changing parameters of an MFP timer, whilst an interrupt using that timer is already active. i haven't found an emulator which duplicates this behaviour so far, however when using bugaboo on real hardware you can trap this interrupt very easily.

i hope this was a clear description. i would be very interested to discuss this further with more knowledgable parties than myself, (leonard?) as it seems to be a subtle behaviour, and i'm still not exactly sure why... and i would like to know.

User avatar
unseenmenace
Atari God
Atari God
Posts: 1961
Joined: Tue Sep 21, 2004 9:33 pm
Location: Margate, Kent, UK
Contact:

Postby unseenmenace » Tue Mar 08, 2005 2:17 pm

gwEm wrote:spurious interrupt eh?

actually it is absolutely possible to generate a spurious interrupt on atari ST, especially when using a SID sound routine... as i found out many times... in this case you get a crash with bombs after a random period of time.

simply redirect the vector to a dummy rte to fix these problems.

The SSD driver I was looking at does indeed point $60 to an RTE. Thanks for the explanation Gwem
UNSEEN MENACE
Several STFM's, 4MB STE, 2MB TT with 1.2GB Hard Drive and 14MB Falcon with 540MB Hard Drive,
Lynx 2 and Jaguar with JagCD
Member of GamebaseST and AtariLegend team
Check out my website at http://unseenmenace.110mb.com

ijor
Hardware Guru
Hardware Guru
Posts: 3889
Joined: Sat May 29, 2004 7:52 pm
Contact:

Postby ijor » Tue Mar 08, 2005 3:33 pm

gwEm wrote:actually it is absolutely possible to generate a spurious interrupt on atari ST, especially when using a SID sound routine... as i found out many times... in this case you get a crash with bombs after a random period of time.


If you look at the MFP datasheet it is obvious that it can generate the conditions for a spurious interrupt. However the fact that they indeed happen in the ST is quite interesting.

The MFP will generate a spurious interrupt if interrupts are disabled (by changing the IERA/IERB registers) at the “precise point”. The precise point would be after the system (but not necessarily the CPU, see below) triggered an MFP interrupt, and before the CPU drives the interrupt acknowledge cycle.

If the MFP was connected directly to the CPU, spurious interrupts probably couldn’t happen. However in the ST, GLUE seats in the middle and handles all the interrupt timing. It is possible that GLUE introduces a delay between detecting a change in the MFP interrupt request signal and actually propagating the change to the CPU IPL signals (it is even possible that GLUE make some kind of latching). This would create a window long enough for the “precise point” described above.

this spurious interupt seems to occur when changing parameters of an MFP timer ...


The other possibility is an undocumented MFP quirk. Specially if the above quote is exact. In theory, changes to the “timer parameters” could never generate a spurious interrupt. Only changes to the interrupt channels can. So it would be interesting exactly what you mean by “changing parameters on an MFP timer”.

gwEm
Captain Atari
Captain Atari
Posts: 220
Joined: Tue Jun 08, 2004 4:43 pm
Location: London, UK
Contact:

Postby gwEm » Tue Mar 08, 2005 5:07 pm

ijor wrote:
this spurious interupt seems to occur when changing parameters of an MFP timer ...


The other possibility is an undocumented MFP quirk. Specially if the above quote is exact. In theory, changes to the “timer parameters” could never generate a spurious interrupt. Only changes to the interrupt channels can. So it would be interesting exactly what you mean by “changing parameters on an MFP timer”.


let me recreate that test i did again, then i will tell you exactly what i change at the time of spurious interrupt. it could well be the mask or enable registers.

gwEm
Captain Atari
Captain Atari
Posts: 220
Joined: Tue Jun 08, 2004 4:43 pm
Location: London, UK
Contact:

Postby gwEm » Tue Mar 08, 2005 5:34 pm

i couldn't wait ;)

yes, the spurious interrupt occurs when i mask a timer. i did not notice an occurance of the SPI when changing data and control registers.

if i kill interrupts with the status reg before masking the timer interrupt, then the SPI occurs as soon as the status register is set to re-enable interrupts.

hope this is clear.

ijor
Hardware Guru
Hardware Guru
Posts: 3889
Joined: Sat May 29, 2004 7:52 pm
Contact:

Postby ijor » Tue Mar 08, 2005 7:00 pm

gwEm wrote:if i kill interrupts with the status reg before masking the timer interrupt, then the SPI occurs as soon as the status register is set to re-enable interrupts.


It happens always or sometimes? Can you do the following test:

Disable interrupts at the CPU SR. Wait for a timer interrupt to be pending at the MFP. Add a delay. Mask or disable MFP interrupts at the MFP. Add another delay. Reenable interrupts at the CPU. Do you still get a spurious interrupt?

gwEm
Captain Atari
Captain Atari
Posts: 220
Joined: Tue Jun 08, 2004 4:43 pm
Location: London, UK
Contact:

Postby gwEm » Tue Mar 08, 2005 10:57 pm

sadly a pre-delay is not possible with my sid sound routine (i'm using automatic interrupt clearing mode).

however a delay afterwards appears to have no effect on the frequency of SPI occurances, which occur very approximately every minute or so.

ijor
Hardware Guru
Hardware Guru
Posts: 3889
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Spurious interrupt

Postby ijor » Wed Nov 30, 2011 5:13 am

ijor wrote:If the MFP was connected directly to the CPU, spurious interrupts probably couldn’t happen. However in the ST, GLUE seats in the middle and handles all the interrupt timing. It is possible that GLUE introduces a delay between detecting a change in the MFP interrupt request signal and actually propagating the change to the CPU IPL signals (it is even possible that GLUE make some kind of latching).


Correcting myself (after more than six years) :) No, I was wrong. GLUE doesn't introduce any significant delay to the IPL signals (no latching), and then it has (almost) nothing to do with spurious interrupts.

Both the MFP and the CPU are the ones that introduce some internal delays to the interrupt signals processing. This is not much different than other similar interrupt issues we discussed recently.

Gunstick
Captain Atari
Captain Atari
Posts: 275
Joined: Thu Jun 20, 2002 6:49 pm
Location: Luxembourg
Contact:

Re: What is $60 for? spurious interrupt

Postby Gunstick » Sun Jan 05, 2020 11:11 pm

Hi

I found a source code which apparently deliberately creates a spurious interrupt. And it's called 'MK_NMI' but I think that's mislabeled.
This happens when setting timers in the MFP in an incorrect way.

I am a bad MFP / timer programmer, so when I do, I do it wrong and have to put an RTE into $60 :lol:

Code: Select all

        clr.b   $fffffa0f.w     ;service A
        clr.b   $fffffa19.w     ; 1:4 A
        move.b  #%11011111,$fffffa0b.w ;pend A   !generates spurious interrupt !!!!!!


George

ijor
Hardware Guru
Hardware Guru
Posts: 3889
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: What is $60 for? spurious interrupt

Postby ijor » Tue Jan 14, 2020 7:54 pm

As I described already, a spurious interrupt would happen if you disable an interrupt after the CPU already decided to trigger the interrupt exception. The CPU takes the decision to take an interrupt a few cycles before the end of an instruction.

Suppose an MFP interrupt it is just going to be pending at the CPU. Suppose you write to the MFP to disable the pending interrupt. And suppose that if you wouldn't disable the interrupt, then it will be proceed at the following instruction. As said, the CPU takes the decision to trigger the exception a few cycles before the end of the instruction. By the time the write to the MFP is completed and the interrupt is disabled, it is too late. The CPU is already comited to the interrupt and will start exception processing after that instruction completes.

Once at the interruption exception, after several cycles, the CPU will perform the interrupt acknowledge cycle. By then the interrupt at the MFP would be disabled completely and it will not acknowledge the interrupt. Hence, a spurious interrupt would be triggered.

Gunstick wrote:

Code: Select all

        clr.b   $fffffa0f.w     ;service A
        clr.b   $fffffa19.w     ; 1:4 A
        move.b  #%11011111,$fffffa0b.w ;pend A   !generates spurious interrupt !!!!!!



I'm not sure this code would actually generate a spurious interrupt. It might, but it depends on the context. What is the rest of the code?
Fx Cast: Atari St cycle accurate fpga core


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 9 guests