Skip to content

07

7-Segment LED Interfacing

DATA SEGMENT 
PORTA EQU 00H
PORTB EQU 02H
PORTC EQU 04H
PORT_CON EQU 06H 
DATA ENDS 

CODE SEGMENT 
MOV AX, DATA 
MOV DS, AX 
ORG 0000H 
START: 
MOV DX, PORT_CON  MOV AL, 10000000B  OUT DX, AL 
MOV SI, 0 
MOV DI, 0 
L0: MOV CX, 1FFFH  L1: MOV AL, S1[SI]  MOV DX, PORTA  OUT DX, AL 
LOOP L1 
INC SI 
CMP SI, 16 
JL L0 
MOV DX, PORT_CON  MOV AL, 10000000B  OUT DX, AL 
JMP START 
ORG 1000H 
S1 DB 11000000B 
DB 11111001B 
DB 10100100B 
DB 10110000B 
DB 10011001B 
DB 10010010B 
DB 10000010B 
DB 11011000B 
DB 10000000B 
DB 10010000B 
DB 10001000B 
DB 10000011B 
DB 11000110B 
DB 10100001B 
DB 10000110B 
DB 10001110B 
CODE ENDS 
END
Last Updated: 2023-01-25 ; Contributors: AhmedThahir

Comments