Keyboard and Display
Keyboard and Display
Keyboard and Display
This program is used to interface an external hex keypad with MP-86L kit.
Input clock to 8279 is 3MHZ. The program waits for a key to be entered from
the keypad and the row and column matrix of the depressed key is stored in
Acc register.
This program is will display the character for the given 7 segment code on all
the digits of the display.
INPUT: Enter the seven segment code at 2000h.
For example - 2000: BA (seven segment code for 2)
I/O PORT ADDRESSES FOR 8279 :
FF52H - Data Register
FF50H - Status Register
FC 60 BA F2 66 D6 DE 70 FE 76 7E CE 9C EA 9E 1E
d .h
8086 DISPLAY PROGRAM:
ADDRES LABEL OPCODE MNEMONICS COMMENTS
S
1050 B0 12 MOV AL,12H CONTROL WORD
1052 BA 52 FF MOV DX,FF52H CONTROL & STATUS REG
1055 EE OUT DX,AL OUT TO 8279
1056 B0 3E MOV AL,3EH FOR FREQ DIVISION
1058 EE OUT DX,AL OUT TO 8279
1059 B0 A0 MOV AL,A0H DISPLAY/WRITE INHIBIT
105B EE OUT DX,AL OUT TO 8279
105C B4 08 MOV AH,08H COUNT OF 8 FOR CLEARING DIS.
105E BA 50 FF MOV DX,FF50H DATA REGISTER ADDRESS
1061 B0 00 MOV AL,00H DATA =0
1063 L1 EE OUT DX,AL OUT TO 8279
1064 FE CC DEC AH DECREMENT LOOP COUNT
1066 75 FB JNE 1063H(L1) WAIT TILL ZERO
1068 L2 BA 52 FF MOV DX,FF52H STATUS REGISTER ADDRESS
106B EC IN AL,DX READ STATUS OF 8279
106C L3 24 01 AND AL,01H FIFO EMPTY?
106E 74 FC JE 106CH(L3) IF YES LOOP BACK
1070 BA 50 FF MOV DX,FF50H DATA REGISTER ADDRESS
1073 BB 00 20 MOV BX,2000H DATA I/P ADDRESS
1076 8A 07 MOV AL,[BX] READ THE INPUT CODE
1078 EE OUT DX,AL TO 8279 DATA REGISTER
1079 EB ED JMP 1068H(L2) JMP L2