Interrupts are features of 8051 that cause 8051 stop work on one process and start work on another. interrupts are signal that tells the controller to stop running the current task so that a new one can be started. For example, hardware interrupts are generated when a switch is pressed or when the key is pressed . Software interrupts are generated by a program

assume there are Switch, 8051 and buzzer. if there is interrupt occur than the buzzer should be ON. I want to use hardware interrupt.
There are two external interrupts EX0 and EX1 to serve external devices. In AT89c51 P3.2 (INT0) and P3.3 (INT1) pins are available for external interrupts 0 and 1 respectively. An external interrupt notifies the microcontroller that an external device needs its service.
EA = 1; if EA = 1 means Enable Global Interrupt
EA = 0; If EA disable Global Interrupt
IT0 = 1; Edge triggered interrupt mode
EX0 = 1; Enable external interrupt
EX0 = 0; Disable external interrupt
switch =1 logic high switch ON
switch =0 logic off switch OFF
Buzzer = 1 ring the buzzer
buzzer =0 stop buzzer
I want set interrupt by programming, if the interrupt occur buzzer will ring bell. how to set interrupt in program?

assume there are Switch, 8051 and buzzer. if there is interrupt occur than the buzzer should be ON. I want to use hardware interrupt.
There are two external interrupts EX0 and EX1 to serve external devices. In AT89c51 P3.2 (INT0) and P3.3 (INT1) pins are available for external interrupts 0 and 1 respectively. An external interrupt notifies the microcontroller that an external device needs its service.
EA = 1; if EA = 1 means Enable Global Interrupt
EA = 0; If EA disable Global Interrupt
IT0 = 1; Edge triggered interrupt mode
EX0 = 1; Enable external interrupt
EX0 = 0; Disable external interrupt
switch =1 logic high switch ON
switch =0 logic off switch OFF
Buzzer = 1 ring the buzzer
buzzer =0 stop buzzer
I want set interrupt by programming, if the interrupt occur buzzer will ring bell. how to set interrupt in program?

