User Tools

Site Tools


base:launching_long_tasks_from_irq_handler

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
base:launching_long_tasks_from_irq_handler [2016-03-15 12:50]
bitbreaker
base:launching_long_tasks_from_irq_handler [2016-11-23 10:54] (current)
bitbreaker
Line 110: Line 110:
         rti         rti
 </​code>​ </​code>​
 +
 +A even more convenient variant is to use the stack for register saving:
 +
 +<​code>​
 +irq1
 +        pha
 +        txa
 +        pha
 +        tya
 +        pha
 +        dec $d019
 +        ​
 +        dec counter
 +        bne +
 +        ​
 +        lda #$08
 +        sta counter
 +        cli
 +        jsr long_task
 ++
 +        pla
 +        tay
 +        pla
 +        tax
 +        pla
 +        rti
 +</​code>​
 +
 +Now you can run a long task that can finish somewhen between the next 8 interrupts.
base/launching_long_tasks_from_irq_handler.txt ยท Last modified: 2016-11-23 10:54 by bitbreaker