Menu

Interrupt

Help
2006-11-21
2013-05-30
  • Stefano Bonomi

    Stefano Bonomi - 2006-11-21

    Needing to implement Interrupt routine in my code, I had a look to documentation, but i found no reference nor example about Interrupt usage with GCBasic....

    Am i wrong?

    Thanks for your answer

     
    • Hugh Considine

      Hugh Considine - 2006-11-22

      The current version of GCBASIC doesn't have interrupts implemented fully. However, with the latest update at http://gcbasic.sourceforge.net/newfiles/update.zip it is possible to insert code at the interrupt vector, which is run whenever an interrupt occurs.

      To add an interrupt routine, create a subroutine called "Interrupt". This will be called whenever an interrupt occurs. You'll need to set up the interrupt manually, as GCBASIC doesn't yet have the ability to do this.

      I am working on interrupts at present, along with a few other things. I've made some major changes to the error checking in GCBASIC, so please let me know if you get any strange error messages with the latest update. It is mostly debugged, but there could still be a few false syntax errors being generated.

       
    • Nobody/Anonymous

      Folks, what is the current state of interupt support on GCbasic?  If I give a routine the explicit name 'Interrupt' as Hugh suggested above, does it actually get called without me having to do anything else?  It does seem that, in the absence of GCbasic support, I could set up INTCON and the interrupt routine vector manually; then the ORG statement would have to work so I could make sure that the interrupt routine was assembled into the right place; then of course RETFIE would have to work so I could return cleanly.  Does this work?  There has to be a better way! Would like to get this sorted becasue interrupts are so fundamental to those of us developing hardware.

      Thanks,

      Clive

       
    • Hugh Considine

      Hugh Considine - 2007-07-29

      If you add a subroutine called Interrupt, GCBASIC will automatically insert code to jump to it at the interrupt vector. The latest version of GCBASIC (http://gcbasic.sourceforge.net/newfiles/update.zip) also automatically adds context saving and restoring code for W, STATUS and FSR.

      It's still necessary to set up the interrupt manually, and to check the bits of various SFRs to determine what action to take. This can be done in GCBASIC, without having to alter the assembly file after it has been generated.

       
    • Nobody/Anonymous

      I am most interested in this, but despite going over the docs in detail, I found nothing. Is there a good writeup on managing interrupts in GC Basic anywhere?

      As it is implied, real use of them is more than just a subroutine.

      Thanks,

      Skip

       
    • kent_twt4

      kent_twt4 - 2008-10-14

      Check out the html help file in the GCBasic directory.  There is now the "On Interrupt" command, and is explained there.  Early on there was the sub Interrupt, which is more or less deprecated now?

      Here is an example using the On Interrupt command.   https://sourceforge.net/forum/forum.php?thread_id=2061852&forum_id=579125
      GCBasic enables the necessary interrupt registers, or if not, set them manually.

      Using the forum/search might bring up a thread on what you are looking for?

       
    • Nobody/Anonymous

      It was in the 'update'. Thanks.

      I downloaded from the main download links, but had to hunt for the update. Now I know where it is, but being a first timer, it wasn't as prominent as it probably should be...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.