OBJECT:Write a program to read 8-bit data from port B. Complement this data & send it back to port A of IC8255-PPI in mode-0. Control word- 83H Port Address of Control Register- FFFE Port Address of Port A- FFF8 Port Address of Port B- FFFA INSTRUMENT REQUIRED:8086 Microprocessor Trainer Kit. PROGRAM:
MEMORY LOCATION
MACHINE CODE
OPCODE
OPERAND
0200
BA FE FF
MOV
DX,FFFE
0203
B083
MOV
AL,83H
0205
EE
OUT
DX,AL
0206
BA FA FF
LOOP1: MOV
DX,FFFA
0209
EC
IN
AL,DX
020A
F6 D0
NOT
AL
020C
BA F8 FF
MOV
DX,FFF8
020F
EE
OUT
DX,AL
0210
75
F4
JMP LOOP1
0212
F4
HLT
DESCRIPTION:
To solve the given objective we have taken a Control Word to control the input.
83H is the memory location where the control word i.e. Input is placed or stored. Control word has a program which is used to make the Microprocessor Unit(MPU) understand the Input. Logic Controller Interface Card is used when we do not want to use 7-segment LED display.
To solve the given objective we have taken the following steps:
BIT PATTERN FOR CONTROL WORD
D7
D6
D5
D4
D3
D2
D1
D0
1
0
0
0
0
0
1
1
Move the data register (DX) to the memory location where the Control word i.e. 83H is stored, i.e. at FFFE.
Move the control word 83H to the AL register.
Complement the data of port B i.e. FFFA using NOT instruction and sent it back to port A i.e. FFF8 using a loop to JMP at port A.
And finally Halt, the program.
INPUT:
MEMORY LOCATION
VALUE
FFF8 (Address of Port A)
00
FFFA (Address of Port B)
03
FFFE (Address of Control Register)
83
OUTPUT:
MEMORY LOCATION
VALUE
FFF8 (Address of Port A)
FC
FFFA (Address of Port B)
03
FFFE (Address of Control Register)
83
RESULT: The complemented data from port address FFFA i.e. Port B has been transferred to port address FFF8 i.e. Port A using IC8255-PPI in mode-0.