AMX 86 Procedures
K
A
DAK
235
ajflagrd, ajflagrddi ajflagrd, ajflagrddiajflagwr ajflagwr
Purpose Read Processor Flags
Read Processor Flags and Disable Interrupts
Write Processor Flags
Used by n Task n IS P n Timer Procedure n Restart Procedure n Exit Procedure
Setup unsigned int flags;
.
.
flags = ajflagrd(); /* Read current flags */
flags = ajflagrddi(); /* Read current flags and */
/* then inhibit interrupts */
.
.
ajflagwr(flags); /* Restore flags */
Results Ajflagrd and ajflagrddi return the state of the processor status register
(FLAGS) at the time of the call.
Upon return from ajflagrddi, interrupts are disabled.
Upon return from ajflagrd, interrupts are untouched.
Ajflagwr writes parameter flags to the processor status register (FLAGS)
and returns nothing.
Upon return from ajflagwr, interrupts are enabled or disabled according
to the state of the interrupt enable flag (IF) in parameter flags.
Restrictions Interrupts should be enabled within a short time after they are disabled or
system performance will be degraded.
Note The assembly language sequence for ajflagrd and ajflagrddi is:
PUSHF
POP AX ;AX = processor flags
CLI ;Omit for ajflagrd
The assembly language sequence for ajflagwr is:
PUSH <flags>
POPF
Note These functions can be called from your main() program before AMX has
been launched or after AMX has been shut down.
See Also ajdi, ajei