8051 microcontroller programming: Interfacing with push button and displaying the number of button presses
This is a good practice question. PROGRAM: ORG 00H MOV 30H,#0C0H MOV 31H,#0F9H MOV 32H,#0A4H MOV 33H,#0B0H MOV 34H,#99H MOV 35H,#92H MOV 36H,#82H MOV 37H,#0F8H MOV 38H,#80H MOV 39H,#90H MOV 3AH,#088H MOV 3BH,#83H MOV 3CH,#0C6H MOV 3DH,#0A1H MOV 3EH,#86H MOV 3FH,#8EH MOV R0,#30H SETB P1.0 MOV P2,@R0 HERE: JB P1.0,HERE HERE1: JNB P1.0,HERE1 INC R0 MOV A,@R0 MOV P2,A SJMP HERE END