It is currently Wed Dec 12, 2018 7:52 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Sep 06, 2018 9:16 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2124
Location: Fukuoka, Japan
I have been asking a question in another thread about the scanline counter and one thing that is required to be done for it to work is that the I flag be removed (CLI). Now that I will be starting to write the interrupt code and may need to chain them, there is one point that is maybe not specific to the MMC3 and decided that it would be better to make a different thread about it.

When the code for an interrupt is executed, since some of them will be chained and the code is not reentrant, do you need to set the I flag at the beginning of the task to avoid another interrupt to be called (and remove the flag at the end)?

In the case of the MMC3 you have to acknowledge the IRQ, is it something common in most IRQ system? Should the acknowledgement be done at the beginning or end of the IRQ?


Top
 Profile  
 
PostPosted: Thu Sep 06, 2018 9:23 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7012
Location: Canada
The IRQ itself automatically sets the interrupt flag, along with pushing the return address and flags to the stack. There is no need to set it, it is already set by the time you enter the IRQ handler. (Similarly, it's automatically cleared by RTI when it pops the flags from the stack.)


Top
 Profile  
 
PostPosted: Thu Sep 06, 2018 9:30 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2124
Location: Fukuoka, Japan
oh, that's good to know. My concerns were founded but it's already handled by the system. In the case of the MMC3 acknowledgement, I don't need to worry when to do it since the flag is set and another IRQ wont be triggered.

I think that conclude that thread, that was a fast one. Thanks!


Top
 Profile  
 
PostPosted: Thu Sep 06, 2018 10:52 pm 
Offline

Joined: Wed Nov 30, 2016 4:45 pm
Posts: 119
Location: Southern California
See the 6502 interrupts article at http://wilsonminesco.com/6502interrupts/ , especially starting with 1.3 at the subtitle "GETTING TO THE NUTS AND BOLTS." Oh, and uh... Enjoy my outdated cartoons.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources


Top
 Profile  
 
PostPosted: Fri Sep 07, 2018 8:20 am 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2124
Location: Fukuoka, Japan
When I was searching about interrupt for the 6502 this is maybe the first page I found ;) I will check it in more details later then. thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group