Jameco Electronics 3000, 2000 manual C.3 Interrupts, Interrupt Under System Control

Models: 3000 2000

1 349
Download 349 pages 5.72 Kb
Page 330
Image 330
C.3 Interrupts

C.3 Interrupts

When enabled for User mode access, a peripheral interrupt (if it is capable of generating an interrupt) can only be requested at Interrupt Priority Level -2 or -1. Interrupts (and RSTs and SYSCALL) all enter the System mode automatically. There will be times, however, that an interrupt should be handled in the User mode. The solution to this is for the System mode interrupt vector to reenter User mode before calling the User mode interrupt handler. An example of both system and user interrupt handling is shown in Figure C-1.

INTERRUPT UNDER SYSTEM CONTROL

 

ISR (system)

 

Application code (user)

Application code (user)

INTERRUPT UNDER USER CONTROL

 

ISR (system)

 

Application ISR (user)

Application code (user)

Application code (user)

Figure C-1. Interrupt Handing in System/User Mode

Some sample code for both System mode interrupts and User mode interrupts is shown below.

system_isr:

; jumped to from interrupt vector table

... handle interrupt ...

 

sures

; reenter previous mode

ret

 

user_isr:

; jumped to from interrupt vector table

push su

; preserve current SU stack

setusr

; enter user mode

... handle interrupt ...

 

pop su

; restore previous SU stack

sures

; reenter previous mode

ret

 

User’s Manual

321

Page 330
Image 330
Jameco Electronics 3000, 2000 manual C.3 Interrupts, Interrupt Under System Control, Interrupt Under User Control