Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

CLI and STI (asm) in my ISR ? (Announce)

posted by bretjohn(R) Homepage E-mail, Rio Rancho, NM, 17.02.2015, 16:38

The short answer is: No, CLI/STI won't fix your problem.

It is quite possible that your subroutine takes too long, you are overflowing the stack, or any one (or some combination) of several other issues you could be having. You'll need to do some more in-depth troubleshooting to fully understand and isolate what's going on.

For example, if you think the problem is a stack overflow (and that's pretty likely based on your symptoms), you can test for that specific issue. It should be pretty easy to monitor/display the value of the stack pointer (SP) and see if it's what you think it should be. If your program provides its own stack space, it makes things even easier since the value of SP should be pretty consistent. If your program doesn't provide its own stack space, you can still monitor things but it's a little trickier to see if the problem is really related to the stack. Simply knowing that the problem is a stack overflow doesn't solve the problem, of course, but helps you figure out where to start looking. CLI/STI won't fix a stack overflow problem.

And, just so you know, it's NEVER a good idea to call a subroutine from an IRQ handler (like INT 08) that takes a long time to process. If a lot of processing needs to take place, you usually need to gather the appropriate data during the IRQ handler and put it in some kind of buffer, and then process the data in the buffer from outside the IRQ handler when timing isn't as critical.


Complete thread:

Back to the forum
Board view  Mix view
15115 Postings in 1359 Threads, 249 registered users, 21 users online (0 registered, 21 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum