Академический Документы
Профессиональный Документы
Культура Документы
CONTROL
Control REG
Control Data
ADDRESS
62H
60H
PROGRAM 1:
AIM:
To initialize 8279 and to display the character "A" in the first digit of the display. However, before sending codes to the
display RAM, a write display RAM control word should be sent. Then, write the data to be displayed, to the data
register.
ADDRESS
9100
9102
9104
9106
9108
910A
910C
910E
9110
9112
9114
9116
9118
911A
911C
OPCODE
3E 00
MNEMONICS
MVI A,00
D3 62
3E CC
D3 62
3E 90
D3 62
3E 88
D3 60
3E FF
D3 60
D3 60
D3 60
D3 60
D3 60
76
OUT CNT
MVI A,CC
OUT CNT
MVI A,90 ;
OUT CNT
MVI A,98 ; data
OUT DAT
MVI A,FF
OUT DAT
OUT DAT
OUT DAT
OUT DAT
OUT DAT
HLT
PROGRAM 2:
READ A KEY:
AIM:
To read a key and store the key code in memory location 9200. This code will be entered into the FIFO whenever a
key is pressed. To read a key, procedure to be followed is,
ADDRESS
9150
9152
9154
9157
9159
915B
915D
9160
OPCODE
DB 62
E6 07
CA 50 91
3E 40
D3 62
DB 60
32 00 92
76
MNEMONICS
LOOP: IN CNT
ANI 07
JZ LOOP
MVI A,40H
OUT CNT
IN DAT
STA 9200
HLT
PROGRAM 3:
ROLLING DISPLAY:
AIM:
To display the rolling message 'HELP US' in the display. The initialization of 8279 is same as that of Example-1. Then,
the data is fetched from address 9200CH and displayed in the first digit of the display. The next data is displayed in
the second Digit of the display, since in the command word for 'write display RAM' the Auto Increment flag is set. A
time delay is given between successive digits for a lively display
ADDRESS
9100
9103
9105
9107
9109
910B
910c
910F
9111
9112
9114
9117
9118
OPCODE
21 2C 92
16 0F
3E 10
D3 62
3E CC
D3 62
3E 90
D3 62
7E
D3 60
CD 1F 91
23
15
MNEMONICS
LXI H,9200H
MVI D,0FH
MVI A,10H
OUT CNT
MVI A,0CCH
OUT CNT
MVI A,90H
OUT CNT
LOP:
MOV A,M
OUT DAT
CALL DELAY
INX H
DCR D
9119
911C
911F
9121
9123
9124
9127
9128
912B
C2 11
C3 00
06
0E FF
0D
C2 23
05
C2 21
C9
91
91
91
91
JNZ LOP
JMP START
DELAY: MVI B,0A0H
LOP1:
MVI C,0FFH
LOP2:
DCR C
JNZ LOP 2
DCR B
JNZ LOP1
RET
LOOK-UP TABLE:-
9200
FFH
FFH
FFH
FFH
9204
FFH
FFH
FFH
FFH
9208
98H
68H
7CH
C8H
920C
FFH
ICH
29H
FFH
PROGRAM 4:
ACCEPT A KEY AND DISPLAY IT:
AIM:
To accept a key from the Hex keyboard and display it in the display. The initialization of 8279's FIFO RAM
and DISPLAY RAM are the same as that given in example 3. A lookup table is provided to obtain the corresponding
display codes for the keys
ADDRESS OPCODE
9100
06 08
9102
3E 00
9104
D3 62
9106
3E CC
9108
D3 62
910A
3E 90
910C
D3 62
910E
3E FF
9110
D3 60
9112
05
9113
C2 10 91
9116
DB 62
9118
E6 07
911A
CA 16 91
MNEMONICS
MVI B,08
MVI A,00H
OUT CNT
MVI A,0CCH
OUT CNT
MVI A,90H
OUT CNT
MVI A,0FFH
BACK:
OUT DAT
DCR B
JNZ BACK
LOOP: IN CNT
ANI 07H
JZ LOP
911D
911F
9121
9123
9125
9126
9128
9129
912B
3E 40
D3 62
DB 60
E6 0F
4 6F
26 92
7E
D3 60
C3 16 91
MVI A,040H
OUT CNT
IN DAT
ANI 0F
MOV L,A
MVI H,92
MOV A,M
OUT DAT
JMP LOOP
LOOK-UP TABLE:9200
0CH
9FH
4AH
9204
99H
29H
28H
8FH
9208
08H
09H
88H
38H
920C
6CH
1AH
68H
0BH
E8H
CONTROL
Control REG
Control Data
ADDRESS
40A2H
40A0H
OPCOD
ADDRESS
MNEMONICS
90
9100
9103
9105
9106
9108
9109
910B
40
A2
74 00
F0
74 CC
F0
74 90
F0
MOV DPTR,#40A2
MOV A,#00
MOVX @DPTR,A
MOV A,#CC
MOVX @DPTR,A
MOV A,#90
MOVX @DPTR,A
90
910C
910F
9111
9112
9114
9116
9117
9119
40
A0
74 88
F0
78 05
74 FF
F0
D8 FD
80 FE
MOV DPTR,#40A0
MOV A,#88
MOVX @DPTR,A
MOV R0,#05
MOV A,#FF
LOOP: MOVX @DPTR,A
DJNZ R0,LOOP
HERE: SJMP HERE
PROGRAM 2:
READ A KEY:
AIM:
To read a key and store the key code in memory location 9200. This code will be entered into the FIFO whenever a
key is pressed. To read a key, procedure to be followed is,
1) Read the status word
2) Check for a key closure:
This can be done by checking the least significant 3 bits of the status word. If it zero, it means there is no key
closure, so keep checking again.
3) If a key closure is encountered, read the data from FIFO RAM, and store this data (key code) in memory location
9200
The following program waits for a key to be pressed in the keyboard, reads the same and stores it in the location
9200
ADDRESS
9100
9103
9104
9106
9108
910A
910B
910E
910F
9112
9113
PROGRAM 3:
ROLLING DISPLAY:
AIM:
OPCODE
90 40 A2
E0
54 07
60 FB
74 40
F0
90 40 A0
E0
90 86 00
F0
80 FE
MNEMONICS
MOV DPTR,#40A2
WAIT:
MOVX A,@DPTR
ANL A,#07
JZ WAIT
MOV A,#40
MOVX @DPTR,A
MOV DPTR,#40A0
MOVX A,@DPTR
MOV DPTR,#9200
MOVX @DPTR,A
HERE:
SJMP HERE
To display the rolling message 'HELP US' in the display. The initialization of 8279 is same as that of Example-1. Then,
the data is fetched from address 9200CH and displayed in the first digit of the display. The next data is displayed in
the second Digit of the display, since in the command word for 'write display RAM' the Auto Increment flag is set. A
time delay is given between successive digits for a lively display
ADDRESS
9100
9103
OPCODE
90 40 A2
78 00
9105
79 92
9107
74 10
9109
910A
910C
910D
910F
9110
9112
9114
9115
9118
9119
911C
911D
9120
8600
8602
8604
8605
8607
8609
F0
74 CC
F0
74 90
F0
89 83
88 82
E0
90 40 A0
F0
12 86 00
08
B8 0F F0
02 91 00
7C A0
7D FF
00
DD FD
DC F9
22
LOOK-UP TABLE:9200
FFH
FFH
FFH
FFH
9204
FFH
FFH
FFH
FFH
9208
98H
68H
7CH
C8H
920C
FFH
1CH
29H
FFH
PROGRAM 4:
ACCEPT A KEY AND DISPLAY IT:
MNEMONICS
MOV DPTR,#40A2
MOV R0,#00
MOV R1,#92 : to
initialize
MOV A,#10 : look-up
table
MOVX @DPTR,A : at
8700
MOV A,#CC
MOVX @DPTR,A
MOV A,#90
MOVX @DPTR,A
LOOP:
MOV DPH,R1
MOV DPL,R0
MOVX A,@DPTR
MOV DPTR,#40A0
MOVX @DPTR,A
LCALL DELAY
INC R0
CJNE R0,#0F,LOOP
LJMP START
DELAY:
MOV R4,#A0
LOOP2 : MOV R5,#FF
LOOP1 : NOP
DJNZ R5,LOOP1
DJNZ R4,LOOP2
RET
START:
AIM:
To accept a key from the Hex keyboard and display it in the display. The initialization of 8279's FIFO RAM
and DISPLAY RAM are the same as that given in example 3. A lookup table is provided to obtain the corresponding
display codes for the keys
ADDRESS
9100
9102
9104
9107
9109
910A
910C
910D
910F
9110
9112
9115
9116
9118
911B
911C
911E
9120
9122
9123
9126
9127
9129
912B
912D
912E
9131
9132
LOOK-UP TABLE:9200
0CH
9FH
4AH
9204
99H
29H
28H
8FH
9208
08H
09H
88H
38H
920C
6CH
1AH
68H
0BH
E8H
OPCODE
79 86
78 08
90 40 A2
74 00
F0
74 CC
F0
74 90
F0
74 40
90 40 A0
F0
D8 FD
90 40 A2
E0
54 07
60 FB
74 40
F0
90 40 A0
E0
54 0F
F5 82
89 83
E0
90 40 A0
F0
80 E4
MNEMONICS
MOV R1,#92
MOV R0,#08
MOV DPTR,#40A2
MOV A,#00
MOVX @DPTR,A
MOV A,#CC
MOVX @DPTR,A
MOV A,#90
MOVX @DPTR,A
MOV A,#FF
MOV DPTR,#40A0
LOOP: MOVX @DPTR,A
DJNZ R0,LOOP
AGAIN: MOV DPTR,#40A2
WAIT: MOVX A,@DPTR
ANL A,#07
JZ WAIT
MOV A,#40
MOVX @DPTR,A
MOV DPTR,#40A0
MOVX A,@DPTR
ANL A,#0F
MOV DPL,A
MOV DPH,R1
MOVX A,@DPTR
MOV DPTR,#40A0
MOVX @DPTR,A
SJMP AGAIN
CONTROL
Control REG
Control Data
ADDRESS
40A2H
40A0H
PROGRAM 1:
DISPLAY DATA "A":
AIM:
To initialize 8279 and to display the character "A" in the first digit of the display. However, before sending codes to
the display RAM, a write display RAM control word should be sent. Then, write the data to be displayed, to the data
register.
OPCOD
ADDRESS
1100
1103
1105
1106
1108
1109
110B
110E
1110
1111
1113
1116
1117
1119
E
BA 52 FF
B0 00
EE
B0 CC
EE
B0 90
BA 50 FF
B0 88
EE
B0 FF
B9 05 00
EE
E2 FD
EB E5
MNEMONICS
START:MOV DX,FF52
MOV AL,00
OUT DX,AL
MOV AL,CC
OUT DX,AL
MOV AL,90
MOV DX,FF50
MOV AL,88
OUT DX,AL
MOV AL,FF
MOV CX,0005
LP1:
OUT DX,AL
LOOP LP1
JMP START
PROGRAM 2:
READ A KEY:
AIM:
To read a key and store the key code in memory location 1200. This code will be entered into the FIFO whenever a
key is pressed. To read a key, procedure to be followed is,/p>
1) Read the status word
2) Check for a key closure:
This can be done by checking the least significant 3 bits of the status word. If it zero, it means there is no key
closure, so keep checking again.
3) If a key closure is encountered, read the data from FIFO RAM, and store this data (key code) in memory location
1200
The following program waits for a key to be pressed in the keyboard, reads the same and stores it in the location
1200
OPCOD
ADDRESS
1100
1103
1106
1107
1109
110B
110D
1110
1111
1114
1115
1117
E
BB 00
BA 52
EC
A8 07
74 FB
B0 40
BA 52
EE
BA 50
EC
88 07
F4
12
FF
FF
FF
MNEMONICS
MOV BX,1200
MOV DX,FF52
LOP1: IN AL,DX
TEST AL,07
JZ L0P1
MOV AL,40
MOV DX,FF52
OUT DX,AL
MOV DX,FF50
IN AL,DX
MOV [BX],AL
HLT
PROGRAM 3:
ROLLING DISPLAY:
AIM:
To display the rolling message 'HELP US' in the display. The initialization of 8279 is same as that of Example-1. Then,
the data is fetched from address 1200CH and displayed in the first digit of the display. The next data is displayed in
the second Digit of the display, since in the command word for 'write display RAM' the Auto Increment flag is set. A
time delay is given between successive digits for a lively display
OPCOD
ADDRESS
1100
1103
1106
1108
110B
110C
110E
110F
1111
1112
E
BE 00 12
B9 0F 00
B0 10
BA 52 FF
EE
B0 CC
EE
B0 90
EE
8A 04
MNEMONICS
START:MOV SI,1200
MOV CX,000F
MOV AL,10
MOV DX,FF52
OUT DX,AL
MOV AL,CC
OUT DX,AL
MOV AL,90
OUT DX,AL
LOP1: MOV AL,[SI]
1114
1117
1118
111B
111C
111E
1300
1303
1304
1306
BA 50 FF
EE
E8 E5 01
46
E2 F4
EB E0
BA FF A0
4A
75 FD
C3
MOV DX,FF50
OUT DX,AL
CALL 1300
INC SI
LOOP LOP1
JMP START
DELAY:MOV DX,A0FF
DEC DX
JNZ 1303
RET
LOOK-UP TABLE:1200
FFH
FFH
FFH
FFH
1204
FFH
FFH
FFH
FFH
1208
98H
68H
7CH
C8H
120C
FFH
1CH
29H
FFH