I have an 8051 receiving an external interrupt. In the ISR I have to read the state of a pin1 and do the following: