On Tue, Jul 09, 2002 at 09:46:10AM +0800, Pang wrote: > Hi all, > > I would like to get some advice from everyone on how best to tackle > this basic problem. My assembly codes > are segregated into different possible states of the system that i > build. I think it can be considered a Moore state machine. > > Now, of the many states, there is one state that every states goes to > when the condition is right. Let say the condition is a Emergency > switch. Once inside the state, some algorithm is executed and when > the switch is flip back, the control will jump to only a particular > state, let's call it A state. > > So my question is, what is the best way to implement this? Hardware > interrupt, Software interrupt or just plain old polling method? My answer is only half joking: The way that works. As long as your method doesn't interfere with the operation of the other code, then it doesn't matter. Often one uses interrupts when there isn't time for the processor to sit around polling. But if those cycles are not going to be used for anything else, then polling is fine. Make it work, then optimize. BAJ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body