0% found this document useful (0 votes)
34 views2 pages

7 Segments

The document contains code to detect key presses and output corresponding codes. It clears a port and calls an identification function for each port bit, setting the bit if a key is pressed. The identification functions check other port bits to determine which key is pressed, setting a flag and outputting a code if a match is found. The code then jumps back to repeat the process of checking each port bit for key presses.

Uploaded by

Coz Animation
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views2 pages

7 Segments

The document contains code to detect key presses and output corresponding codes. It clears a port and calls an identification function for each port bit, setting the bit if a key is pressed. The identification functions check other port bits to determine which key is pressed, setting a flag and outputting a code if a match is found. The code then jumps back to repeat the process of checking each port bit for key presses.

Uploaded by

Coz Animation
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Begin: CLR P0.

3
CALL IdCode0
SETB P0.3
JB F0,Done

CLR P0.2
CALL IdCode1
SETB P0.2
JB F0,Done

CLR P0.1
CALL IdCode2
SETB P0.1
JB F0,Done

CLR P0.0
Call IdCode3
SETB P0.0
JB F0,Done

Done: JMP Begin


JMP $

IdCode0: JNB P0.4,Keycode03


JNB P0.5,Keycode13
JNB p0.6,Keycode23
RET

IdCode1: JNB P0.4,Keycode02


JNB P0.5,Keycode12
JNB p0.6,Keycode22
RET

IdCode2: JNB P0.4,Keycode01


JNB P0.5,Keycode11
JNB p0.6,Keycode21
RET

IdCode3: JNB P0.4,Keycode00


JNB P0.5,Keycode10
JNB p0.6,Keycode20
RET

Keycode02: SETB F0
MOV R7,#82h
MOV P1,R7
RET

Keycode12: SETB F0
MOV R7,#92h
MOV P1,R7
RET

Keycode22: SETB F0
MOV R7,#99h
MOV P1,R7
RET

Keycode03: SETB F0
MOV R7,#0B0h
MOV P1,R7
RET

Keycode13: SETB F0
MOV R7,#0A4h
MOV P1,R7
RET

Keycode23: SETB F0
MOV R7,#0F9h
MOV P1,R7
RET

Keycode01: SETB F0
MOV R7,#90h
MOV P1,R7
RET

Keycode11: SETB F0
MOV R7,#80h
MOV P1,R7
RET

Keycode21: SETB F0
; MOV R7,#0F80h
MOV R7,#0F8h
MOV P1,R7
RET

Keycode00: SETB F0
MOV R7,#0BFh
MOV P1,R7
RET

Keycode10: SETB F0
MOV R7,#0C0h
MOV P1,R7
RET

Keycode20: SETB F0
MOV R7,#89h
MOV P1,R7
RET

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy