Instruction Set Description
180
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
CPUX
4.6.2.20 EINT
* EINT
Enable (general) interrupts
Syntax
EINT
Operation
1
→
GIE
or
(0008h .OR. SR
→
SR / .src .OR. dst
→
dst)
Emulation
BIS #8,SR
Description
All interrupts are enabled.
The constant #08h and the SR are logically ORed. The result is placed into the SR.
Status Bits
Status bits are not affected.
Mode Bits
GIE is set. OSCOFF and CPUOFF are not affected.
Example
The general interrupt enable (GIE) bit in the SR is set.
PUSH.B
&P1IN
BIC.B
@SP,&P1IFG
; Reset only accepted flags
NOP
; Required due to pipelined CPU architecture
EINT
; Preset port 1 interrupt flags stored on stack
; other interrupts are allowed
BIT
#Mask,@SP
JEQ
MaskOK
; Flags are present identically to mask: jump
......
MaskOK
BIC
#Mask,@SP
......
INCD
SP
; Housekeeping: inverse to PUSH instruction
; at the start of interrupt subroutine. Corrects
; the stack pointer.
RETI
NOTE:
Enable interrupt
Due to the pipelined CPU architecture, setting the general interrupt enable (GIE) requires
special care.
•
The instruction immediately after the enable interrupts instruction (EINT) is
always executed, even if an interrupt service request is pending.
•
Include at least 1 instruction between the clear of an interrupt enable or interrupt
flag and the EINT instruction. For example: Insert a NOP instruction in front of
the EINT instruction.
•
Never clear the general interrupt enable (GIE) immediately after setting it. Insert
at least 1 instruction in between such sequence.
The rules above apply to all instructions that set the general interrupt enable bit. Not
following these rules might result in unexpected CPU execution.