I have interfaced 8255A with 8086. PortA (Mode 0) is defined as input and PortB (Mode 0) and PortC are defined as output. PC0 and and PC1 are set by BSR command. As well as, I have read PortA and send it to PortB using a loop. But it is not working. I have attached the Proteus file. The assembly code is provided with the internal assembler. I have also added the code below.
Code:
DATA SEGMENT
PORTA EQU 00H;0000 0000
PORTB EQU 02H;0000 0010
PORTC EQU 04H;0000 0100
CWR EQU 06H;0000 0110
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
MOV AX,DATA
MOV DS, AX
START:
MOV AL, 90H ;1001 1000-->I/0,MA1,MA2,PA I/O,PCUp I/O, MB, PB I/0, PCl I/O
OUT CWR, AL
MOV AL, 01H ;0000 0001 BSR command PC0
OUT CWR, AL
MOV AL, 03H ;0000 0011 BSR command PC1
OUT CWR, AL
XX:
IN AL,PORTA
OUT PORTB,AL
JMP XX
CODE ENDS
END START
Attachments
-
29.1 KB Views: 3
