Computer Science, asked by jasmine8632, 1 year ago

Assembly language program for traffic light controller using 8086

Answers

Answered by HitlerMehar
13

ASSEMBLY LANGUAGE PROGRAMS:-
MODEL SMALL
.STACK 100
.DATA
CWR EQU 0FFC6 H
PORTA EQU 0FFC0 H
PORTB EQU 0FFC2 H
PORTC EQU 0FFC4 H
.CODE
START:
MOV AX,@DATA
MOV DS,AX
MOV AL,80H
MOV DX,CWR
OUT DX,AL 
MOV AL,F3H
MOV DX,PORTC
OUT DX,AL 
MOV AL,FFH
MOV DX,PORTA
OUT DX,AL 
MOV AL,FFH
MOV DX,PORTB
OUT DX,AL
MOV CL,03H
CALL DELAY
TOP:
MOV AL,EEH
MOV DX,PORTA
OUT DX,AL
MOV AL,EEH
MOV DX,PORTB
OUT DX,AL
MOV CL,02H
CALL DELAY

MOV AL,FCH
MOV DX,PORTC
OUT DX,AL
MOV AL,7DH
MOV DX,PORTA
OUT DX,AL
MOV AL,57H
MOV DX,PORTB
OUT DX,AL
MOV CL,15H
CALL DELAY

MOV AL,E7H
MOV DX,PORTB
OUT DX,AL
MOV AL,FDH
MOV DX,PORTA
OUT DX,AL
MOV AL,EDH
MOV DX,PORTA
OUT DX,AL
MOV CL,02H
CALL DELAY

MOV AL,F7H
MOV DX,PORTB
OUT DX,AL
MOV AL,F0H
MOV DX,PORTC
OUT DX,AL
MOV AL,F1H
MOV DX,PORTA
OUT DX,AL
MOV CL,15H
CALL DELAY

MOV AL,FBH
MOV DX,PORTA
OUT DX,AL
MOV AL,FBH
MOV DX,PORTB
OUT DX,AL
MOV AL,50H
MOV DX,PORTC
OUT DX,AL
MOV CL,15H
CALL DELAY

MOV AL,FEH
MOV DX,PORTA
OUT DX,AL
MOV AL,FEH
MOV DX,PORTB
OUT DX,AL
MOV CL,03H
CALL DELAY

MOV AL,FFH
MOV DX,PORTA
OUT DX,AL
MOV AL,AFH
MOV DX,PORTC
OUT DX,AL
MOV AL,EEH
MOV DX,PORTA
OUT DX,AL
MOV AL,EEH
MOV DX,PORTB
OUT DX,AL
MOV CL,02H
CALL DELAY

MOV AL,BFH
MOV DX,PORTA
OUT DX,AL
MOV AL,BFH
MOV DX,PORTB
OUT DX,AL
MOV CL,15H
CALL DELAY
JMP TOP

DELAY:
MOV BX,10H
D1:
MOV CX,0FFFFH
D2:
LOOP D2
DEC BX
JNZ D1
INT 03H
END START
Answered by pragyakirti12345
0

Answer: Assembly language program is written below

Explanation:

Assembly language for traffic light controller using 8086 :

ASSEMBLY LANGUAGE PROGRAMS:-

MODEL SMALL

.STACK 100

.DATA

CWR EQU 0FFC6 H

PORTA EQU 0FFC0 H

PORTB EQU 0FFC2 H

PORTC EQU 0FFC4 H

.CODE

START:

MOV AX,@DATA

MOV DS,AX

MOV AL,80H

MOV DX,CWR

OUT DX,AL

MOV AL,F3H

MOV DX,PORTC

OUT DX,AL

MOV AL,FFH

MOV DX,PORTA

OUT DX,AL

MOV AL,FFH

MOV DX,PORTB

OUT DX,AL

MOV CL,03H

CALL DELAY

TOP:

MOV AL,EEH

MOV DX,PORTA

OUT DX,AL

MOV AL,EEH

MOV DX,PORTB

OUT DX,AL

MOV CL,02H

CALL DELAY

MOV AL,FCH

MOV DX,PORTC

OUT DX,AL

MOV AL,7DH

MOV DX,PORTA

OUT DX,AL

MOV AL,57H

MOV DX,PORTB

OUT DX,AL

MOV CL,15H

CALL DELAY

MOV AL,E7H

MOV DX,PORTB

OUT DX,AL

MOV AL,FDH

MOV DX,PORTA

OUT DX,AL

MOV AL,EDH

MOV DX,PORTA

OUT DX,AL

MOV CL,02H

CALL DELAY

MOV AL,F7H

MOV DX,PORTB

OUT DX,AL

MOV AL,F0H

MOV DX,PORTC

OUT DX,AL

MOV AL,F1H

MOV DX,PORTA

OUT DX,AL

MOV CL,15H

CALL DELAY

MOV AL,FBH

MOV DX,PORTA

OUT DX,AL

MOV AL,FBH

MOV DX,PORTB

OUT DX,AL

MOV AL,50H

MOV DX,PORTC

OUT DX,AL

MOV CL,15H

CALL DELAY

MOV AL,FEH

MOV DX,PORTA

OUT DX,AL

MOV AL,FEH

MOV DX,PORTB

OUT DX,AL

MOV CL,03H

CALL DELAY

MOV AL,FFH

MOV DX,PORTA

OUT DX,AL

MOV AL,AFH

MOV DX,PORTC

OUT DX,AL

MOV AL,EEH

MOV DX,PORTA

OUT DX,AL

MOV AL,EEH

MOV DX,PORTB

OUT DX,AL

MOV CL,02H

CALL DELAY

MOV AL,BFH

MOV DX,PORTA

OUT DX,AL

MOV AL,BFH

MOV DX,PORTB

OUT DX,AL

MOV CL,15H

CALL DELAY

JMP TOP

DELAY:

MOV BX,10H

D1:

MOV CX,0FFFFH

D2:

LOOP D2

DEC BX

JNZ D1

INT 03H

END START

___________________________________________________

Related links :

Write an assembly language program that will clear a CMOS setting in windows operating system.

https://brainly.in/question/35510439

What is an assembly language ?

https://brainly.in/question/5119943

#SPJ3

Similar questions