can i check the bit IE0 to decide whether an int0 interrupt is coming?
jnb ie0,$ clr ie0 ;interrupt service here
"when i simulate in protues it seems wrong." Have you tried simulating it in the Keil simulator? For questions about Proteus, you will need to go to a Proteus forum, or call their support...