Title: ?CPU??????????????,CPU????????????????????????CPU???????????????,?????????????????????????????,?????????????,????????????????????????????
1??? ??
- ?CPU??????????????,CPU????????????????????????CPU
???????????????,?????????????????????????????,????
?????????,????????????????????????????
29.1 ????
- 9.1.1 ????????????????
- ?????????????CPU???????????,CPU?????????????????
???,??????????????? - ???????CPU?,????????????????????
3(No Transcript)
4(No Transcript)
59.1 ????
69.1 ????
- 9.1.2 ????
- ??????????,??????CPU?????,?????????CPU????,???????
????CPU???,?????????????,?????????????,???CPU?????
?,CPU????????????,??????????????????,?????????????
????,??????????
79.1 ????
- 9.1.3 ????
- ????????
- ?????????
89.1 ????
- 9.1.3 ????
- ??????,????
- ??????,CPU??????????????CPU????????????????,????
?CPU????????????,??????CPU???????
????1
????2
????3
99.2 ??????????
- 9.2.1 ???????????
- ?????????
- ???????
- 1???????????????,?????????????????CPU,??CPU???????
??? - 2??CPU?????????????????,?????????,?????????????
-
109.2 ??????????
11A??????,?????,???????A???????
???????
A??????????,???????A?????????????????
A??????????????,8255A?A??CPU????,??CPU?A???
12(No Transcript)
139.2 ??????????
- 9.2.1 ???????????
- ?????????
- ?????????????????????????????????????????CPU,??CPU
??????????????????????????
????? ? ?
14A??????,?????,???????A???????
???????
A??????????,???????A?????????????????
A??????????????,8255A?A??CPU????,??CPU?A???
MOV AL,00001000 ???? MOV ???,AL
MOV AL,00001001 ????? MOV ???,AL
159.2 ??????????
- 9.2.1 ???????????
- CPU??????????IF
- CPU?????????????????????????????
- ??CPU,??8086CPU,?????????????????????????????????
????,???IF?1?,CPU??????????????????????????????,??
????????,??IF???1,CPU?????????????????????????????
?????? - IF?0 ??? CLI
- IF?1 ??? STI
169.2 ??????????
- 9.2.2 ??????
- ?????????????CPU??????CPU???,????????????????????
???????????????,??????????CPU??CPU????????,???????
???????????????CPU????????,CPU??????????,?????????
???????
17??????INTR
????
????FF
????FF
CPU??????
189.2 ??????????
- 9.2.3 ??????
- ????????????
- ??????????CPU?????
- CPU??????????????????
- CPU?????????????????
199.2 ??????????
- 9.2.3 ??????
- ??????
- ???????????1,???????????????????CPU?
- ??????
- CPU??????????????3???
- ? ?????
- ? CPU?????
- ? CPU???????.
-
-
209.2 ??????????
- 9.2.3 ??????
- ??????
- CPU??????????????
- 1? ????
- 2?CS?IP??FR???????
- 3???????????CS?,?????IP??
- ??CPU????,????????????????????????
21- push ax 1?????
-
- push bx
- sti 2????
- 3?????
- cli 4????
- pop bx 5?????
-
- pop ax
- sti 6?????????
- reti
229.3 ???????????
- ????????????????CPU???????????????????????
????????,CPU????????????????????,?????????????????
?????
23?!!!
249.3 ???????????
- 9.3.1 ?????
- ??????
- 1??????,
- 2???????????????????????????????
259.3 ???????????
26- IN AL.IPORT ??????????
- TEST AL,80H ?0???????
- JNZ SEVO ?,?0???????
- TEST AL.40H ?,?1???????
- JNZ SEVl ?,?1???????
- TEST AL.20H ?,?2???????
- JNZ SEV2 ?,?2???????
- TEST AL.10H ?,?3???????
- JNZ SEV3 ?,?3???????
- ?????????
27???? ???
289.3 ???????????
- 9.3.1 ?????
- ??????
- ??????INTR???????INTA??????????????????
??,???????????CPU?,?????,??????CPU?????????????CPU
?????,?????,??CPU?????????,??????????????
299.3 ???????????
T
CS
309.3 ???????????
- 9.3.2 ?????
- ??????
- ?????????????,?????
319.3 ???????????
- 9.3.2 ?????
- ??????
- 1?????
- ????????????????????????????
32????? IEI1, ?????
????? IEOIEI INTR
????
????
????
330
341
0
359.3 ???????????
- 9.3.2 ?????
- ??????
- 2?????
- 74LSl48???8?3????????,????16????????TTL??.
36I0 I1 I7
000
37I0 I1 I7
000
38(No Transcript)
39(No Transcript)
409.4 8086????
- 8086?????????????,?????????????,?????????,????
????????????????????????????,??????????????????,??
?????????????,???????CPU???INTR???NMI????????? - ???????????????????????
41(No Transcript)
429.4 8086????
- 9.4.1 ??????
- ????????????????CPU?????????IF?????,?8086CPU?
NMI?????NMI?????????????,????????,?CPU???????????0
2?
43(No Transcript)
44 459.4 8086????
- 9.4.2 ?????
- ????????????????,???????CPU?????????IF???????
??CPU???????????8086CPU?INTR??????????????????????
,CPU?????,???????4???????????????,????????????????
??,??????????????
46(No Transcript)
479.4 8086????
- 9.4.3 ????
- ??????8086????????????,???????????????????
489.4 8086????
- 9.4.3 ????
- ??????
- ????????,????0?????,???????????????????,?????
??????????????????,??CPU????0???
499.4 8086????
- 9.4.3 ????
- ??????
- ??????????,??INTO??????CPU????4???,??????
- ??
- mov al,40h
- add al,40h
- into
509.4 8086????
- 9.4.3 ????
- ???????????
- (1)????
- ?8086CPU????????TF???1?,8086CPU????????
,??CPU??????????????l???? - TF????????8??
- (2)????
- INT3???1????(0CCH),
- ?????????
-
519.4 8086????
- 9.4.3 ????
- ?????
- ??????????????????????? INT n (CD
21),???n?????????CPU????????INT
n?,??????????????n???? - int n ?call far 4n
529.4 8086????
- 9.4.4 ????????
- ??????????????
- 1?????????CPU?????????????????????,?????????,?????
??????????? - 2????????????????????,??????????????????,?????????
??????????????????????????????????????????????,???
???,?????????????????????????????????????,????????
???????????,??????
539.4 8086????
- 9.4.4 ????????
- ??????? INT n ?????
- ??????INT n,??????????????????????CPU?,??CPU
???????,???????,CPU???????,?????CPU???????????????
,???????INT n??,???n??????????????????????????
?????????INT n?????,?CPU???????INT
n?????,???????????????
54 MOV AL,10 MOV BX,100 MOV BL,100 ADD
AL,BL
INT n
INT n
559.5 8086CPU?????
- 9.5.1 8086CPU??????? 8086CPU?????????????
- 1???????,????,INT n
- 2?NMl
- 3?INTR
- 4??????
569.5 8086CPU?????
579.5 8086CPU?????
- 9.5.3 ????????
- ??????
- CLI ???
- MOV AX,0
- MOV ES,AX ????????0
- MOV DI, n4 ?????????DI
- MOV AX,OFFSET INT_VCE ?????????????AX
- CLD
- STOSW ??????????
- MOV AX, SEG INT_VCE ???????????AX
- STOSW ???????????
- STI ???
-
-
589.5 8086CPU?????
- 9.5.3 ????????
- ??????
- INT-TBL SEGMENT AT 0 ??INT-TBL?,?????0
- ORG n4 ??????
- DD INTVCE ?????????
- INT-TBL ENDS
- ????
- MCODE SEGMENT ???
- ????
- INTVCE PROC FAR ??????
-
- IRET
- INTVCE ENDP
-
598.5 8086CPU?????
- 8.5.3 ????????
- ???????
- ??25H?????
- AL?????
- DSDX????????????????
- ??DS??
-
60- PUSH DS
- MOV DX,SEG INT60H ?????DS
- MOV DS,DX
- MOV DX,OFFSET INT60H ?????DX
- MOV AL,60H ??????AL
- MOV AH,25H
- INT 21H 25H????
- POP DS
618.5 8086CPU?????
- 8.5.3 ????????
- ???????
- ??????????6BH,???????????????????00lACH???????
??.???????????1000H,?????2000H?
62- MOV AX,,0
- MOV DS,AX ?????????0
- MOV AX,2000H
- MOV 01ACH, AX ??????01AC???
- MOV AX.1000H ???
- MOV 01ACH2l, AX
639.6 ????????8259
641?????
000
IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7
IR0
???????
IR1
IR2
IR3
IR4
IR5
IR6
IR7
1 1
???? ???
652???8259?8259??
3?????(?????) 4?????(??????????)
669.6 ????????8259
- ??8259A???????
- (?)????????
- 1.??????
- 8259A?????????????????????????,IR0??????,IR1??
????,????,IR7??????? -
-
679.6 ????????8259
- 2.???????
- ?????????????????,??????,???????????,????????
?,??????????,??,??????,??????????????????? - ???????????8259A???????
-
-
689.6 ????????8259
- 3.??????
- ?IR0IR7???????????????
- ??????????
- IR0gtIR1gtIR2gtIR3gtIR4gtIR5gtIR6gtIR7
- ??IR0????????,????
- IR1gtIR2gtIR3gtIR4gtIR5gtIR6gtIR7gtIR0
- ??IR4????????,????
- IR5gtIR6gtIR7gtIR0gtIR1gtIR2gtIR3gtIR4
-
-
-
699.6 ????????8259
- 4.?????????
- ????????????,?????????????
-
-
-
709.6 ????????8259
- (?).??????
- ?????
- ??????????
- ????????????
719.6 ????????8259
- (?)? 8259A?????????
- ???????????
- ??EOI??
- ??EOI??
- ??EOI??
72000
IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7
IR0
???????
IR1
IR2
IR3
IR4
IR5
IR6
IR7
1 1
???? ???
739.6 ????????8259
- ?? 8259A??
- (?)?8259A???????
- ICW1??????
- ??????????????
-
???????,?? 0 0 0 1 0
0 0 1
749.6 ????????8259
- ?? 8259A??
- (?)?8259A???????
- ICW2??????
- ????????
-
????????080F 0 0 0 0
1 x x x
759.6 ????????8259
- ?? 8259A??
- (?)?8259A???????
- ICW3??????
- ?8259A????????
-
? ?
769.6 ????????8259
- ?? 8259A??
- (?)?8259A???????
- ICW4??????
- ?????????????,????????
-
D11???EOI,Dl0????EOI D4?SFNM????????,D41???????
??,D40??????. ?? 0 0 0 0
0 0 0 1
779.6 ????????8259
- ?? 8259A??
- (?)?8259A??????
- 0CW1??????
- ??????????
-
1?????? 0 0
0 1 0 0 0 1
789.6 ????????8259
- ?? 8259A??
- (?)?8259A??????
- 0CW2??????
- ???????????,????????
-
0
??????EOI?? 0
0 1 0 0 0 0 0
79000
IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7
IR0
???????
IR1
IR2
IR3
IR4
IR5
IR6
IR7
1 1
???? ???
MOV AL,20H OUT ??(A00),AL
809.6 ????????8259
- ?? 8259A??
- (?)?8259A??????
- 0CW3??????
- ???????8259A??????????????
-
????
819.7 ????
- ????????????
- ??????
- ???????????
- ??????
- 1????
- 2??????????
- 3???8259A???????
- 4????
- 5???????????
82???????
- INTO??
- ???????????,
- ???BL0FFH
- ???BL00?
83- INTO1 PROC ??????
- PUSH AX
- MOV BL,0FFH
- POP AX
- IRET ????
- INTO1 ENDP
-
84- DATA SEGMENT ?????
- ADD1 DB ?
- ADD2 DB ?
- DATA ENDS
- CODE SEGMENT ?????
- ASSUME CS CODE,DSDATA
- START MOV AS,DATA
- MOV DS,AX
85- MOV AX,0 ???????
- MOV ES,AX
- MOV DI,044
- ????????????
- MOV AX,OFFSET INTO1 ??MOV AX,CS
- CLD
- STOSW
- ????????????
- MOV AX,SEG INTO1
- STOSW
86- MOV BL,0 ???
- MOV AL,ADD1 ??ADD1ADD2
- ADD AL,ADDD2
- INTO ????,?????
- MOV AL,BL
- MOV AX,4C00H
- INT 21H
- HLT
87- INTO1 PROC ??????
- PUSH AX
- MOV BL,0FFH
- POP AX
- IRET ????
- INTO1 ENDP
-
- CODE ENDS
- END START
88???????
- ?????????,????????8255A?A???????????,??
?????????????1S??8255A?????80H-86H,8253?????88H-8E
H,?8259?????90H-96H,?8259?????98H-9EH
89/INTA
INTR
/INTA
/INTA
INT
INT
CA0 CA1 CA2
CA0 CA1 CA2
5V
0V
SP
8259
8259
SP
IR0 IR7
IR0 IR7
5V 1KHz
OUT0 GATA0 CLK0
8255
8253
A0 A1 A7
5V
90- 8255A?A??????????0???,?8253??0??????????0,????????
???? - 8255A??????10001011B??A??,B???,C????
- 8253??0??????00110001B?????????0,BCD????
91- 8259????
- 1?????????
- 2???? ICW1?ICW2?ICW3?ICW4
92- ?8259??
- ICW1?????,??
- ???90H00010001B
- ICW2?????,??92H08H
- ICW3??????,??92H00000100B
- ICW4????????,?????????
- ???92H00000001B
-
93- ?8259??
- ICW1?????,??
- ???98H00010001B
- ICW2?????,??9AH30H
- ICW3??????,??9AH00000010B
- ICW4????????,?????????
- ???9AH00000001B
-
94-
- SHIFT_DAT DB 0FEH
-
- CLI ???
- CLD ?????????
- MOV AX,0
- MOV ES,AX
- MOV DI,431H
- MOV AX,OFFSET INT_31H
- MOV ESDI,AX
- INC DI
- INC DI
- MOV AX,SEG INT_31H
- MOV ESDI,AX
95- ???8259
- MOV AL,11H ??ICW1
- OUT 90H,AL
- MOV AL,08 ??ICW2
- OUT 92H,AL
- MOV AL,04 ??ICW3
- OUT 92H,AL
- MOV AL,01 ??ICW4
- OUT 92H,AL
- MOV AL,01101011B ??IOW1,??IR2,IR4,IR7??
- OUT 92H,AL
96- ???8259
- MOV AL,11H ??ICW1
- OUT 98H,AL
- MOV AL,30H ??ICW2
- OUT 9AH,AL
- MOV AL,02 ??ICW3
- OUT 9AH,AL
- MOV AL,01 ??ICW4
- OUT 9AH,AL
- MOV AL,00000000B ??IOW1,??IR0IR7??
- OUT 9AH,AL
97- ??8255?8253
- MOV AL,10001011B ??8255A
- OUT 86H,AL
- MOV AL,0
- OUT 80H,AL
- MOV AL,00110001B ??8253??0
- OUT 8EH,A
- MOV AL,00
- OUT 88H,AL
- MOV AL,10H
- OUT 88H,AL
- STI ???
- ??????
98- ???????
- ????8255?A?????,???SHIFT_DAT?????,
- ????8253??0,?????????????,
- ?8259A????EOI??,?????????
99- INT31H PROC FAR ???????
- PUSH AX ????
- PUSHF
- MOV AL,SHIFT_DAT ?8255?A???
- OUT 80H,AL
- ROL AL,1 ??SHIFT_DAT??
- MOV SHIFT_DAT,AL ???????
100- MOV AL,00110001B ????8253
- OUT 8EH,AL
- MOV AL,00
- OUT 88H,AL
- MOV AL,10H
- OUT 88H,AL
101- ?EOI??
- MOV AL,20H ??EOI???8259
- OUT 98H,AL ??8259?EOI??
- OUT 90H,AL ??8259?EOI??
-
- POPF ????
- POP AX
- IRET ????
- INT31H ENDP
1029.8 IBM-PC?????
- 9.8.1 ????
- ?PC/XT??,???8259A??????,???8??????PC/AT?????8
259A??????,???15?????
1039.8 IBM-PC?????
- 9.8.1 ????
- ???
- ??IR0,IR1
- ??IR0,IR1,IR2,IR3,IR4,IR4,IR5,IR6,IR7
- ??IR3,IR4,IR5,IR5,IR7
- ?????
- ??00H-07H
- ??70H-77H
104(No Transcript)
105(No Transcript)
1069.8 IBM-PC?????
- 9.8.2 PC????????
- ?????????????
- ??8259A????????I/O?????21H,??8?????8?????,????
?????????0??1??????????????????0????????????,???1?
?????????????(??)? - ??8259A????????I/O?????A1H
107- ??,???????,??????????
- MOV AL,11111101B
- OUT 21H,AL
- ????????????.?????????
- IN AL,21H
- AND AL,11111101B
- OUT 21H,AL
1089.8 IBM-PC?????
- 9.8.2 PC????????
- ????????
- ???????????,???8259A??????????????????????
??EOI,??????EOI??,????????I/O?????20H,???????????
- MOV AL,20H
- OUT 20H,AL
- ??,???????8259A?????????,??????????????
?????EOI?????8259A????????I/O?????A0H -