In the earliest days of microcomputers I implemented a music synthesis program using wavetable lookup on an 8008 computer. On this computer, the instruction to be executed when an interrupt occured was actually be entered into front panel switches! Typically, you would use a "RST" instruction, which was a one-byte call to a specific address. However, for my music synthesizer, I programmed in a RETurn instruction instead. My code then looked something like this: MainLine: ...setup to play a rest... NextNote: Call GenerateNote ...read keyboard and figure out what note to play... goto NextNote GenerateNote: ...an infinite loop to generate the note... This trick eliminated any need to check for 'end-of-note' condition in my sound generation loop and allowed for a substantially higher quality result. The point of this is that you sometimes want to do something tricky with interrupts -- not just call a closed subroutine. Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) ----- Original Message ----- From: "Ed Browne, Precision Electronic Solutions" To: Sent: Sunday, October 07, 2001 10:00 PM Subject: Re: [PIC]: > James, > I have often used pop and push operators on processors where they were > available in order to affect program direction upon leaving an interrupt > routine, which was based upon tasks performed within that interrupt routine. > > I would suggest that you experiment with whatever task you were thinking > about that prompted your email, then report back to the group with your > findings. I can see where it might be possible to exploit the stack as you > have suggested, but I can also see that the idea needs a lot of refinement > before it would be useful. Sounds like pop and push without explicit > operators... I have some vague ideas about how it could be done, but they > are not well thought out nor elegant. > > Regards, > Ed > > > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of James Caska > Sent: Sunday, October 07, 2001 7:11 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: > > > Its not a direct stack pointer control rather a 'Trick' to gain some control > over the stack pointer. There are numerous reasons why you would like > control over the stack pointer, the abrupt exception handling concept was > used only as an example. Some of the higher end PIC's have push and pop > operators which allow direct stack manipulations but I was refering to the > ability to take advantage of the circular buffer employed by the stack. > > Regards, > James Caska > caska@virtualbreadboard.com > ujVM - 'The worlds smallest java virtual machine' > > > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Bob Barr > Sent: Monday, 8 October 2001 9:50 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: > > > Olin Lathrop wrote: > > > > > If you know the depth of your entry point you can use this technique to > > > flush the stack :-) Which can be handy if you need to abruptly exit a > >call > > > path. > > > >How is messing about with the stack more "handy" than doing a GOTO? > > > > Is it really even possible to 'flush' the stack? > > The limited number of PIC types that I have worked with don't have any way > (other than calls and returns) of affecting the stack. > > Do some PIC types provide direct stack pointer control? > > Regards, Bob > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu