Page 1 of 1

How to avoid unexpected results while the value of SFRS Register changed before ISR occurs?

Posted: 31 May 2021, 16:12
by a_ziliu
On interrupt, user must to be pushed the current SFRS value to the stack. Also on a return from interrupt, the stack is popped to the SFRS register.

Keil C51:


Note: push_(SFRS)以及_pop_(SFRS) are defined in the file.

IAR EW8051:

Note: __sfr __no_init volatile unsigned char SFRS @ 0x91;