0% found this document useful (0 votes)
35 views

Assembly Language

The document describes an assembly code program that implements a 3x8 decoder with an enable input and inverted outputs to multiplex a 4x3 keypad and display. The program uses ports P0, P1, P2 and P3 to scan the rows and columns of the keypad and display the output. It checks the state of each key using conditional jump instructions and stores the pressed key in register B.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Assembly Language

The document describes an assembly code program that implements a 3x8 decoder with an enable input and inverted outputs to multiplex a 4x3 keypad and display. The program uses ports P0, P1, P2 and P3 to scan the rows and columns of the keypad and display the output. It checks the state of each key using conditional jump instructions and stores the pressed key in register B.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Republic of the Philippines

Mindanao State University - Iligan Institute of Technology


COLLEGE OF ENGINEERING
Department of Electrical Engineering and Technology

MULTIPLEXING DISPLAY AND KEYPAD

Laboratory Activity 7
Microprocessor Microcontroller Systems and Design Laboratory
EEE184.1

Submitted By:
Arboleda, Trisha Isobelle V.
III – BS ECE

Submitted To:
Prof. Francis Jann Alagon, CpE
EEE184.1 Professor
i. Assembly code
3X8 DECODER WITH ENABLER INPUT (INVERTED OUTPUT) Code
ORG 0H MOV B, A
MOV A, #01100000B
MOV P2, #0FEH CPL A
SJMP MAIN MOV P3, A
MOV A, B
MAIN:
ROW0: LJMP MOVE
MOV P0, #14
MOV A, P1 KEYPAD2:
CPL A CJNE A, #04H, KEYPAD3

KEYPAD1: MOV B, A
CJNE A, #08H, KEYPAD2 MOV A, P2
RR A
MOV B, A MOV P2, A
MOV A, P2 MOV A, B
RR A
MOV P2, A MOV B, A
MOV A, B MOV A, #11011010B
CPL A
MOV P3, A CJNE A, #02H, ROW2
MOV A, B
MOV B, A
LJMP MOVE MOV A, P2
RR A
KEYPAD3: MOV P2, A
CJNE A, #02H, ROW1 MOV A, B

MOV B, A MOV B, A
MOV A, P2 MOV A, #10111110B
RR A CPL A
MOV P2, A MOV P3, A
MOV A, B MOV A, B

MOV B, A LJMP MOVE


MOV A, #11110010B
CPL A ROW2:
MOV P3, A MOV P0, #0BH
MOV A, B MOV A, P1
CPL A
LJMP MOVE
KEYPAD7:
ROW1: CJNE A, #08H, KEYPAD8
MOV P0, #13
MOV A, P1 MOV B, A
CPL A MOV A, P2
RR A
KEYPAD4: MOV P2, A
CJNE A, #08H, KEYPAD5 MOV A, B

MOV B, A MOV B, A
MOV A, P2 MOV A, #11100000B
RR A CPL A
MOV P2, A MOV P3, A
MOV A, B MOV A, B

MOV B, A LJMP MOVE


MOV A, #01100110B
CPL A KEYPAD8:
MOV P3, A CJNE A, #04H, KEYPAD9
MOV A, B
MOV B, A
LJMP MOVE MOV A, P2
RR A
KEYPAD5: MOV P2, A
CJNE A, #04H, KEYPAD6 MOV A, B

MOV B, A MOV B, A
MOV A, P2 MOV A, #11111110B
RR A CPL A
MOV P2, A MOV P3, A
MOV A, B MOV A, B

MOV B, A LJMP MOVE


MOV A, #10110110B
CPL A KEYPAD9:
MOV P3, A CJNE A, #02H, MOVE
MOV A, B
MOV B, A
LJMP MOVE MOV A, P2
RR A
KEYPAD6: MOV P2, A
MOV A, B LJMP MOVE

MOV B, A MOVE:
MOV A, #11110110B LJMP MAIN
CPL A
MOV P3, A END
MOV A, B

ii. Sample Output

You might also like