INT0_ISR: 
CLR EX0
SETB INT0_HAS_BEEN_OCCURED
RETI

; somewhere in main():
if (INT0_HAS_BEEN_OCCURED)
{
  INT0_HAS_BEEN_OCCURED = 0;
  do_something();
  IE0 = 0;
  EX0 = 1;
}