?CPU??????????????,CPU????????????????????????CPU???????????????,?????????????????????????????,?????????????,???????????????????????????? - PowerPoint PPT Presentation

1 / 108
About This Presentation
Title:

?CPU??????????????,CPU????????????????????????CPU???????????????,?????????????????????????????,?????????????,????????????????????????????

Description:

Title: Author: hpeng Last modified by: PH Created Date: 4/24/2005 7:38:35 AM Document presentation format: – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 109
Provided by: hpe78
Category:
Tags: cpu

less

Transcript and Presenter's Notes

Title: ?CPU??????????????,CPU????????????????????????CPU???????????????,?????????????????????????????,?????????????,????????????????????????????


1
??? ??
  • ?CPU??????????????,CPU????????????????????????CPU
    ???????????????,?????????????????????????????,????
    ?????????,????????????????????????????

2
9.1 ????
  • 9.1.1 ????????????????
  • ?????????????CPU???????????,CPU?????????????????
    ???,???????????????
  • ???????CPU?,????????????????????

3
(No Transcript)
4
(No Transcript)
5
9.1 ????
  • 9.1.2 ????

6
9.1 ????
  • 9.1.2 ????
  • ??????????,??????CPU?????,?????????CPU????,???????
    ????CPU???,?????????????,?????????????,???CPU?????
    ?,CPU????????????,??????????????????,?????????????
    ????,??????????

7
9.1 ????
  • 9.1.3 ????
  • ????????
  • ?????????

8
9.1 ????
  • 9.1.3 ????
  • ??????,????
  • ??????,CPU??????????????CPU????????????????,????
    ?CPU????????????,??????CPU???????

????1
????2
????3
9
9.2 ??????????
  • 9.2.1 ???????????
  • ?????????
  • ???????
  • 1???????????????,?????????????????CPU,??CPU???????
    ???
  • 2??CPU?????????????????,?????????,?????????????

10
9.2 ??????????
  • 9.2.1 ???????????

11
  • 8255A?????1??

A??????,?????,???????A???????
???????
A??????????,???????A?????????????????
A??????????????,8255A?A??CPU????,??CPU?A???
12
(No Transcript)
13
9.2 ??????????
  • 9.2.1 ???????????
  • ?????????
  • ?????????????????????????????????????????CPU,??CPU
    ??????????????????????????

????? ? ?
14
  • 8255A?????1??

A??????,?????,???????A???????
???????
A??????????,???????A?????????????????
A??????????????,8255A?A??CPU????,??CPU?A???
MOV AL,00001000 ???? MOV ???,AL
MOV AL,00001001 ????? MOV ???,AL
15
9.2 ??????????
  • 9.2.1 ???????????
  • CPU??????????IF
  • CPU?????????????????????????????
  • ??CPU,??8086CPU,?????????????????????????????????
    ????,???IF?1?,CPU??????????????????????????????,??
    ????????,??IF???1,CPU?????????????????????????????
    ??????
  • IF?0 ??? CLI
  • IF?1 ??? STI

16
9.2 ??????????
  • 9.2.2 ??????
  • ?????????????CPU??????CPU???,????????????????????
    ???????????????,??????????CPU??CPU????????,???????
    ???????????????CPU????????,CPU??????????,?????????
    ???????

17
??????INTR
????
????FF
????FF
CPU??????
18
9.2 ??????????
  • 9.2.3 ??????
  • ????????????
  • ??????????CPU?????
  • CPU??????????????????
  • CPU?????????????????

19
9.2 ??????????
  • 9.2.3 ??????
  • ??????
  • ???????????1,???????????????????CPU?
  • ??????
  • CPU??????????????3???
  • ?     ?????
  • ?     CPU?????
  • ?     CPU???????.

20
9.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

22
9.3 ???????????
  • ????????????????CPU???????????????????????
    ????????,CPU????????????????????,?????????????????
    ?????

23
?!!!
24
9.3 ???????????
  • 9.3.1 ?????
  • ??????
  • 1??????,
  • 2???????????????????????????????

25
9.3 ???????????
  • 9.3.1 ?????
  • ??????

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
???? ???
28
9.3 ???????????
  • 9.3.1 ?????
  • ??????
  • ??????INTR???????INTA??????????????????
    ??,???????????CPU?,?????,??????CPU?????????????CPU
    ?????,?????,??CPU?????????,??????????????

29
9.3 ???????????
  • 9.3.1 ?????
  • ??????

T
CS
30
9.3 ???????????
  • 9.3.2 ?????
  • ??????
  • ?????????????,?????

31
9.3 ???????????
  • 9.3.2 ?????
  • ??????
  • 1?????
  • ????????????????????????????

32
????? IEI1, ?????
????? IEOIEI INTR
????
????
????
33
0
34
1
0
35
9.3 ???????????
  • 9.3.2 ?????
  • ??????
  • 2?????
  • 74LSl48???8?3????????,????16????????TTL??.

36
I0 I1 I7
000
37
I0 I1 I7
000
38
(No Transcript)
39
(No Transcript)
40
9.4 8086????
  • 8086?????????????,?????????????,?????????,????
    ????????????????????????????,??????????????????,??
    ?????????????,???????CPU???INTR???NMI?????????
  • ???????????????????????

41
(No Transcript)
42
9.4 8086????
  • 9.4.1 ??????
  • ????????????????CPU?????????IF?????,?8086CPU?
    NMI?????NMI?????????????,????????,?CPU???????????0
    2?

43
(No Transcript)
44
  • ??????NMI????

45
9.4 8086????
  • 9.4.2 ?????
  • ????????????????,???????CPU?????????IF???????
    ??CPU???????????8086CPU?INTR??????????????????????
    ,CPU?????,???????4???????????????,????????????????
    ??,??????????????

46
(No Transcript)
47
9.4 8086????
  • 9.4.3 ????
  • ??????8086????????????,???????????????????

48
9.4 8086????
  • 9.4.3 ????
  • ??????
  • ????????,????0?????,???????????????????,?????
    ??????????????????,??CPU????0???

49
9.4 8086????
  • 9.4.3 ????
  • ??????
  • ??????????,??INTO??????CPU????4???,??????
  • ??
  • mov al,40h
  • add al,40h
  • into

50
9.4 8086????
  • 9.4.3 ????
  • ???????????
  • (1)????
  • ?8086CPU????????TF???1?,8086CPU????????
    ,??CPU??????????????l????
  • TF????????8??
  • (2)????
  • INT3???1????(0CCH),
  • ?????????

51
9.4 8086????
  • 9.4.3 ????
  • ?????
  • ??????????????????????? INT n (CD
    21),???n?????????CPU????????INT
    n?,??????????????n????
  • int n ?call far 4n

52
9.4 8086????
  • 9.4.4 ????????
  • ??????????????
  • 1?????????CPU?????????????????????,?????????,?????
    ???????????
  • 2????????????????????,??????????????????,?????????
    ??????????????????????????????????????????????,???
    ???,?????????????????????????????????????,????????
    ???????????,??????

53
9.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
55
9.5 8086CPU?????
  • 9.5.1 8086CPU??????? 8086CPU?????????????
  • 1???????,????,INT n
  • 2?NMl
  • 3?INTR
  • 4??????

56
9.5 8086CPU?????
  • 9.5.2 8086CPU??????????

57
9.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 ???

58
9.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

59
8.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

61
8.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

63
9.6 ????????8259
  • ??8259A?????

64
1?????
000
IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7
IR0
???????
IR1
IR2
IR3
IR4
IR5
IR6
IR7
1 1
???? ???
65
2???8259?8259??
3?????(?????) 4?????(??????????)
66
9.6 ????????8259
  • ??8259A???????
  • (?)????????
  • 1.??????
  • 8259A?????????????????????????,IR0??????,IR1??
    ????,????,IR7???????

67
9.6 ????????8259
  • 2.???????
  • ?????????????????,??????,???????????,????????
    ?,??????????,??,??????,???????????????????
  • ???????????8259A???????

68
9.6 ????????8259
  • 3.??????
  • ?IR0IR7???????????????
  • ??????????
  • IR0gtIR1gtIR2gtIR3gtIR4gtIR5gtIR6gtIR7
  • ??IR0????????,????
  • IR1gtIR2gtIR3gtIR4gtIR5gtIR6gtIR7gtIR0
  • ??IR4????????,????
  • IR5gtIR6gtIR7gtIR0gtIR1gtIR2gtIR3gtIR4

69
9.6 ????????8259
  • 4.?????????
  • ????????????,?????????????

70
9.6 ????????8259
  • (?).??????
  • ?????
  • ??????????
  • ????????????

71
9.6 ????????8259
  • (?)? 8259A?????????
  • ???????????
  • ??EOI??
  • ??EOI??
  • ??EOI??

72
000
IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7
IR0
???????
IR1
IR2
IR3
IR4
IR5
IR6
IR7
1 1
???? ???
73
9.6 ????????8259
  • ?? 8259A??
  • (?)?8259A???????
  • ICW1??????
  • ??????????????

???????,?? 0 0 0 1 0
0 0 1
74
9.6 ????????8259
  • ?? 8259A??
  • (?)?8259A???????
  • ICW2??????
  • ????????

????????080F 0 0 0 0
1 x x x
75
9.6 ????????8259
  • ?? 8259A??
  • (?)?8259A???????
  • ICW3??????
  • ?8259A????????

? ?
76
9.6 ????????8259
  • ?? 8259A??
  • (?)?8259A???????
  • ICW4??????
  • ?????????????,????????

D11???EOI,Dl0????EOI D4?SFNM????????,D41???????
??,D40??????. ?? 0 0 0 0
0 0 0 1
77
9.6 ????????8259
  • ?? 8259A??
  • (?)?8259A??????
  • 0CW1??????
  • ??????????

1?????? 0 0
0 1 0 0 0 1
78
9.6 ????????8259
  • ?? 8259A??
  • (?)?8259A??????
  • 0CW2??????
  • ???????????,????????

0
??????EOI?? 0
0 1 0 0 0 0 0
79
000
IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7
IR0
???????
IR1
IR2
IR3
IR4
IR5
IR6
IR7
1 1
???? ???
MOV AL,20H OUT ??(A00),AL
80
9.6 ????????8259
  • ?? 8259A??
  • (?)?8259A??????
  • 0CW3??????
  • ???????8259A??????????????

????
81
9.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

102
9.8 IBM-PC?????
  • 9.8.1 ????
  • ?PC/XT??,???8259A??????,???8??????PC/AT?????8
    259A??????,???15?????

103
9.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)
106
9.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

108
9.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
Write a Comment
User Comments (0)
About PowerShow.com