Globally Enabling and Disabling Interrupts
7-12
Suppose the CPU begins processing an interrupt. Just as the interrupt proces-
sing begins, GIE is being cleared by you writing a 0 to bit 0 of the CSR with the
MVC instruction. GIE is cleared by the MVC instruction prior to being copied
to PGIE. Upon returning from the interrupt, PGIE is copied back to GIE, result-
ing in GIE being cleared as directed by your code.
Example 7–2 shows how to disable maskable interrupts globally and
Example 7–3 shows how to enable maskable interrupts globally.
Example 7–2. Code Sequence to Disable Maskable Interrupts Globally
MVC
CSR,B0
; get CSR
AND
-2,B0,B0
; get ready to clear GIE
MVC
B0,CSR
; clear GIE
Example 7–3. Code Sequence to Enable Maskable Interrupts Globally
MVC
CSR,B0
; get CSR
OR
1,B0,B0
; get ready to set GIE
MVC
B0,CSR
; set GIE
Globally Enabling and Disabling Interrupts (Control Status Register–CSR)