base:launching_long_tasks_from_irq_handler
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
base:launching_long_tasks_from_irq_handler [2016-03-15 12:29] – bitbreaker | base:launching_long_tasks_from_irq_handler [2016-03-15 12:33] – bitbreaker | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Launching long tasks from inside a IRQ handler ====== | ====== Launching long tasks from inside a IRQ handler ====== | ||
+ | |||
+ | by Bitbreaker/ | ||
When executing code within an IRQ handler you have to finish things before the next IRQ occurs. But sometimes tasks just take some more time, for that you can spin off those tasks from inside the handler, and allow then upcoming IRQs to happen. | When executing code within an IRQ handler you have to finish things before the next IRQ occurs. But sometimes tasks just take some more time, for that you can spin off those tasks from inside the handler, and allow then upcoming IRQs to happen. | ||
Line 15: | Line 17: | ||
;... your desired irq handler code goes here | ;... your desired irq handler code goes here | ||
+ | lda some_condition | ||
beq skip_long | beq skip_long | ||
Line 25: | Line 28: | ||
lda #$00 | lda #$00 | ||
pha | pha | ||
- | |||
skip_long | skip_long | ||
Line 39: | Line 41: | ||
| | ||
task | task | ||
+ | ; | ||
sta reg_a_ | sta reg_a_ | ||
- | sta reg_x_ | + | stx reg_x_ |
- | sta reg_y_ | + | sty reg_y_ |
; | ; | ||
| | ||
- | ; | + | ; |
lda reg_a_ | lda reg_a_ | ||
ldx reg_x_ | ldx reg_x_ |
base/launching_long_tasks_from_irq_handler.txt · Last modified: 2016-11-23 10:54 by bitbreaker