Tutorial-5
Tutorial-5
Tutorial 5
Q1- Interface keyboard and display controller 8279 with 80386 at address
0080H and 0084H. Write Assembly program to set up 8279 in
scanned keyboard mode with encoded scan, N-Key rollover mode.
Use a 16 character display in right entry display format. Then clear
the display RAM with zeros. Read the FIFO for key closure. If any
key is closed, store it’s code to register CH. Then write the byte 55 to
all the displays. The clock input to 8279 is 2MHz, operate it at 100
KHz?
Answer
A2
Tutorial 5
Answer
AGAIN; MOV AL, 40H ; Read FIFO command for check key closure
OUT 84H, AL
IN AL, 84H ; Read FIFO status
AND AH, 07H ; Mask all bits except the
JZ again ; if any key is pressed, take
IN AL, 80H ; read code
MOV CH, AL
DISPL: : IN AL, 84H ; Wait for clearing of Display RAM by reading FIFO status D bit
TEST AL, 80H
JNZ displ ; wait if D bit is not set wait, else proceed . If 0 it’s ready
MOV AL, 90H ; Proceed to write display
OUT 84H, AL
MOV AL, 55H ; RAM by using write display
OUT 80H, AL ; 55H to all display RAM
JMP AGAIN
Tutorial 5
4
Answer Tutorial 5
5
Answer Tutorial 5
D7 D6 D5 D4 D3 D2 D1 D0 B0H
1 0 1 1 1 0 0 0
Port A : Input ; Port C high: output; Port B &Port C low do not care ;
Mode 1 (01) for port A ; Strobed input
D7 D6 D5 D4 D3 D2 D1 D0
0CH/0DH
0 0 0 0 1 1 0 1/0
6
Answer CNWRD EQU B0H
SCPC60 EQU 0CH
ECPC61 EQU 0DH
PORTA EQU 80H
PORTC EQU 88H
CNREG EQU 8CH
READ: PROC
IN AL, PORTC
TEST AL, PC5
JZ READ
IN AL, PORTA
RET
7
READ END