You are on page 1of 10

; Program to rotate the Stepper Motor in clockwise direction

continuously. The addresses of on-board 8255 are 0FFE6H and 0FFE0H.


ADDRESS

OBJECT

LABELS

MNEMONICS COMMENTS

CODES
0000:2000

BA E6 FF

MOV DX,

; Initialize all

0FFE6

8255 ports
as outputs

0000:2003

B0 80

MOV AL, 80

0000:2005

EE

OUT DX, AL

0000:2006

BA E0 FF

MOV DX,
0FFE0

0000:2009

B0 88

MOV AL, 88

; Output
data to ports

0000:200B

EE

0000:200C

E8 04 00

BACK :

OUT DX, AL
CALL DELAY

; Introduce
delay

0000:200F

D0 C8

ROR AL, 1

; Rotate data
byte for
rotation

0000:2011

EB F8

0000:2013

B9 00 40

JMP BACK
DELAY :

MOV CX,
4000

0000:2016

E2 FE

0000:2018

C3

RPT :

LOOP RPT
RET

Observation:

The Stepper Motor rotates in clockwise direction

continuously.

Conclusion / Result : Thus, we have interfaced the Stepper Motor


to 8086 microprocessor using 8255 and rotated it in clockwise direction.

; Program to rotate the Stepper Motor in anti-clockwise direction


continuously. The addresses of on-board 8255 are 0FFE6H and 0FFE0H.
ADDRESS

OBJECT

LABELS

MNEMONICS COMMENTS

CODES
0000:2000

BA E6 FF

MOV DX,

; Initialize all

0FFE6

8255 ports
as outputs

0000:2003

B0 80

MOV AL, 80

0000:2005

EE

OUT DX, AL

0000:2006

BA E0 FF

MOV DX,
0FFE0

0000:2009

B0 88

MOV AL, 88

; Output
data to ports

0000:200B

EE

BACK :

0000:200C

E8 04 00

OUT DX, AL
CALL DELAY

; Introduce
delay

0000:200F

D0 D0

ROL AL, 1

; Rotate data
byte for
rotation

0000:2011

EB F8

0000:2013

B9 00 40

JMP BACK
DELAY :

MOV CX,
4000

0000:2016

E2 FE

0000:2018

C3

Observation:
continuously.

RPT :

LOOP RPT
RET

The Stepper Motor rotates in anti - clockwise direction

Conclusion / Result : Thus, we have interfaced the Stepper Motor


to 8086 microprocessor using 8255 and rotated it in anti - clockwise
direction.

; Program to interface 8279 Keyboard / Display Controller with the 8086


ESA Trainer Kit and display the string ELECTRO SYSTEMS. INDIA on
the 7-Segment Displays provided on the 8279 Study Card. Encode
method using Encode method.
ADDRESS

OBJECT

LABELS

MNEMONICS COMMENTS

CODE
0000:2000

B9 08 00

MOV CX, 08

0000:2003

B0 00

MOV AL, 00

0000:2005

BA C2 FF

MOV DX,

; Routine to

0FFC2

clear all
displays

0000:2008

EE

OUT DX, AL

0000:2009

B0 90

MOV AL, 90

0000:200B

EE

OUT DX, AL

0000:200C

B0 00

MOV AL, 00

0000:200E

BA C0 FF

MOV DX,
0FFC0

0000:2011

EE

OUT DX, AL

0000:2012

E2 F8

LOOP RPT

0000:2014

BA C2 FF

MOV DX,
0FFC2

0000:2017

B0 10

MOV AL, 10

; 8-bit
character
display, right
entry,

encoded
scan
keyboard
0000:2019

EE

OUT DX, AL

0000:201A

BA C2 FF

MOV DX,
0FFC2

0000:201D

B0 90

MOV AL, 90

; Write to
8279 Display
RAM

0000:201F

EE

0000:2020

BE 00 21

OUT DX, AL
BCK :

MOV SI,

; Routine to

2100

display
ELECTRO

0000:2023

B9 08 00

0000:2026

8A 04

0000:2028

BA C0 FF

MOV CX, 08
BC0 :

MOV AL, [SI]


MOV DX,
0FFC0

0000:202B

EE

OUT DX, AL

0000:202C

46

INC SI

0000:202D

E8 23 00

CALL DLY

; Provide
some delay
between
characters

0000:2030

E2 F4

LOOP BC0

0000:2032

B9 08 00

MOV CX, 08

; Routine to
display
SYSTEMS.

0000:2035

8A 04

0000:2037

BA C0 FF

BC1 :

MOV AL, [SI]


MOV DX,
0FFC0

0000:203A

EE

OUT DX, AL

0000:203B

46

INC SI

0000:203C

E8 14 00

CALL DLY

; Provide
some delay

between
characters
0000:203F

E2 F4

LOOP BC1

0000:2041

B9 08 00

MOV CX, 08

; Routine to
display
INDIA-

0000:2044

8A 04

0000:2046

BA C0 FF

BC2 :

MOV AL, [SI]


MOV DX,
0FFC0

0000:2049

EE

OUT DX, AL

0000:204A

46

INC SI

0000:204B

E8 05 00

CALL DLY

; provide
some delay
between
characters

0000:204E

E2 F4

LOOP BC2

0000:2050

E9 CD FF

JMP BCK

; Repeat
infinitely

0000:2053

51

DLY :

PUSH CX

; Delay
Routine

0000:2054

B9 00 00

MOV CX,
0000

0000:2057

E2 FE

LOOP HERE

0000:2059

59

POP CX

0000:205A

C3

RET

ORG 2100
0000:2100

; display look-up table


97 83 97 93

DB 97, 83,
97, 93

0000:2104

87 13 F3 00

DB 87, 13,

0F3, 00
0000:2108

D6 E6 D6 87

DB 0D6,
0E6, 0D6, 87

0000:210C

97 73 DE 00

DB 97, 73,
0DE, 00

0000:2110

60 73 E5 60

DB 60, 73,
0E5, 60

0000:2114

77 00 04 00

DB 77, 00,
04, 00

Observation:
The string ELECTRO SYSTEMS. INDIA- is
continuously displayed on the 7-segment displays of 8279
study card in sequential fashion.
Result:
Thus, we have interfaced the 8279 Keyboard /
Display Controller with the 8086 ESA Microprocessor Trainer
kit and displayed the desired string on the 7-segment displays