微型计算机原理与接口技术-冯博琴-第7章课后*题答案

发布于:2021-11-29 09:31:48

&I?-&ern?

-B%#,#ZRZ%@J8%E%E-4%%fE@b&1S9mS? M: -BStEi#,f&nz%rn~%4s%E-4z%,gb~E%+wm(#g n ( g g ng)gr nq)lS%mS. 7 . 2 3%% 8253 Z % @ J / t H I @ k $ . #El$@%% CLK 7f;R 17@@% GATE .f)%I]
7.1

I

%fr,E%%I'IBE% GATE Lb%X&!R%~l&@J@k~h3,&7;-+CLK B#@J7;@#;if-% %it%,,ItN OUT % I Z ~ ~ ~ $ % I ~ % Q Y . it%%RG ,OUT %iiifLb$!iQF,f%%IJ-+%E %it%@@N CLK BFbFlBB@J%B#O 3 32 : %w%1+G%,&wu@1+G30w I2 3SBitB0 ' &%AB$l?G ,OUT %$%?%$Yo it%%u@G--+El$@B@El$ OUT a$%% QY,@tZ2-+ CLK B B 9 i t % @ ~ 3 J % , 0 UX#!JiB%$5QFo& G @ Q3?$2Ait T %@l@,#SAR%A@J-Rit%o 3 ' 3 2 7;OUT % g S % % i ~ B E %TcLK@JfiB#, R B B % N x T c ~ ~ , f i J i 32 8 ' &%%.f)i@%,.f)i@A%%it%@l@ o N 3'3 3: &B-H.f)@ir%,tbmirnHG33'3, $%f B i t % o %it%@@ %# N %k~$,S%%LbXf%k@(BP F CLK B#ii%QY,N/2 CLK B # & Q Y ) ,i@$% N/2 ' (~/N)XFCLK. N % 3 % , J Y % ~ @ B 6 X $ % , S t : + ( N + 1 ) / 2 +El$@B#l&Q$, % (N-l)/2+~$%JFJB1i%QY0 3'34 @3'3 E & i t % % R G % ~ - + C L K B # J E l B ~ @ J f i E k # ~ ~ ~ % 5% 3 f B i t % 3 ' 3 t : . E%IJ&3'34 B%l+G3 ,t3'35 %$21+G3. WH42Q CLK % 8253 Z % @ J I # S % E % . GATE 1~'3%I'-J@E%.&%14G %El$%$ GATE &it%2@+%%#%$!i$Y; Tfb-NlG?!qG % @ J I # k $ ,%$&%A it%@l@GGATE %Lb%X-+&ii%3J&@JiE8k$ 7 . 3 8253 ~ % @ Z W / i t % % G i % H33'3,&%1+G 3 ~% E i t % ~ % B f, G $ ?

M: W%@ZW/it%%8253 8 G / t H $ E I @ J I # k 3 ,St:+ : 3'3 0: %4+G3,6 Ei 3EEBit%o ?Z%AB$J?G OUT %?24i%QY,it%%R h3 OUT %%LbRQY,wH%F%+%%$1S%9&&%%it%%RF++%@J 3'3 3'3 1: @4+G3 Ei % S B i t % o fiiR$24+G3B&%Ait%@@G#67F%it
0

+

+

# : &!%B BZ$EiJ% , i t % % 0 ( C N T O > I # T % &
( C N T 2 ) I @ T 3 3 : 2. El$%@$

3 ,it%#

l(CNTl)Hit%jl%% 2

ZMI-Iz, BPM%% 0 . 5 ~ s , M f i % + 8 & i t % % % + i t % @ @

II%!J%:
CNTO : lOps/O. 5ps= 20 CNTl : lms/O. 5ps=2000 CNT2 : ls/O. 5ps= 2 X l o 6

B%,if%% Hit%@J@EB8 16 43%m%&%B,%g32-&+fd%@,EiJ% 2 7
OUT8 1000. %@j$#&?IU

%W 2 E 1-7-1 fiZ ,. J

H

O2

T

ls/lms=

D7

IOR

D7 RD

GATE0 GATE1 GATE2

OUT l

MOV DX ,ODOD3 H MOV AL,16H O U T DX,AL MOV AL, 74H O U T DX,AL MOV AL, OB4 H O U T DX. AI, MOV DX, ODODOH MOV AL, 20 O U T DX ,AI, MOV DX, ODOD1 H MOV AX. 2000 O U T DX, AL MOV AL,AH O U T DX, AL MOV DX, ODOD2 H MOV AX, 1000 O U T DX, AL MOV AL,AH O U T DX, AL

;it?&#, l g 8 i3it?&,7Fi& 0 3
;it%#l , n 7 T i t B g l c , f i & 2 ;it%# 2,X!lsr8TitBYr)i&
2

;3itB# 0 i m A f @

;%it?&# 1 iMt@I@

;sit%# l f @ 2 itm

7.8

8255 & # R F J U I @ $ E h @ k $ 7 ; ?

% % R A I@&k&,

2 2$,#R

B$U C

I@T.ft-&kST? M: 8255 & % R R q U I @ $ E k S 0 $U;k81 T,ii% ~ R ! J q U I @ $ E k &O.k8 A

I W ~ S z ~ m 7 ;3 2 .
k S O m T 8 1 . 7 . 9 $EX$ 8255 ~YJ C
(

% ~ ~ F B2 W,GW B A I ~ ~

m m

c rn~iffmr~t

R2qT@J?&k%BffiSGSfi!3B$,%Arn% fiii&litktE

)&lit0

M:

7.10

k t B ( 8 2 5 5 18&3tQ$YJ%@#)>&t. 8 8255 Zfi&I&lit%B% 3 8 O H - A 3 8 3 H , L @ T k $ A C

0 , A R .B R%$&*

R ,%%% PC4 EUO",PC7 B"l",i&%;l%?&jk@Bo

M: i% 8255 Z R M @ J ? & ~ @ B I ~ BJEW k8@$ ? 4~7;:
MOV DX,OA383H MOV AL,80H OUT DX, AL MOV AL,08H OUT DX ,AL MOV AL,OFH OUT DX, AL
;PC7 f 1 ;PC4 f 0

&IB13B@@%1?0 @EF

;h%f$?$j%#%&hh% DX

;%&@$l?

8 8255 ZRMB R&&t%B% 03F8H-03FBH.A i4 B B 4 R I @ T k 7 t : 0 , A u@%BB%* , C UjEk 4 jG@%@%Jj$%%AU ,R4&#R ? k @ H o Xi@Lbi%% 8255 ZR%%%i?J$@g%B ,#%%@J?&k@@o M: 8255 ZR%,f%M$@$B$UEI 1-7-2 EZ. H ,cE X 8255 f k8#!2$J?,&R@J?&lk@B $nT:
7.11
MOV DX,O3FBH MOV AL,81H OUT DX ,AL

7.12

E W 8 8088 @8l%%&II / O % R $@@H?Z!J@$dqEI 7-47

E%. X%B:

#i!##EIq%%,%% G R . 8 2 5 3 Z R & % U&I&lito 8255 (2) %% 8255 ZR$U 8253 Z R M @ J ? & k @ B . gq ,8253 Z R M O U T 1 %fiiiU* l O O H z k @ , 8 2 5 5 ZRM A a%%* B R N C R % % A . , (3) % 8255 ZR%%-'P I/O &?%IT@@ ,R?XIR&%: @RIH--&3;,%~#Y M PC0 #&,gp c o = o , a q ~ 4 ; ~ e ;C O = I , ~ M n g 1 ~ 3 r 3 i iK ~ j 3 ~ ( 0 - 7, )g P g PB 3~ R@it$$M A A @I PAO-PA3 fiiiU*i%ffifM12$YJ%@,IR LED B/70
(1)

%:
(1) 8255 I Z R & I & ~ ~ % B % : 8000H-FFFFH

;@Ma S # 8255
MOV DX, 8003H MOV AL,8BH O U T DX, AL

;@Ma 8253
MOV DX,0003H MOV AL,76H O U T DX, AL MOV DX,0001H MOV AX, 10000 O U T DX, AL MOV AL, A H O U T DX ,AL

(3)
;8255 S # H @ % ~ T @ @

;~X&~fi#I%E!Xl117%%@5kf(B
DATA SEGMENT BUFFER DB 3FH,06H,5BH,OFH,66H,6DH,7CH,07H

DATA ENDS
i

CODE SEGMENT ASSUME CS : CODE DS: DATA MAIN PROC PUSH DS MOV AX, DATA MOV DS, AX CALL DISP POP DX RET MAIN DISP ENDP PROC PUSH CX PUSH SI XOR CX ,CX CLC LEA SI, BUFFER MOV DX.8002H WAITT: IN AL,DX TEST AL,OlH JZ WAITT MOV DX,8001H IN AL ,DX NEXT: SHR AL, 1 INC CX JC NEXT DEC CX ADD SI, CX MOV AL, [SIJ MOV DX,8000H OUT DX,AL POP SI POP CX RET DISP ENDP CODE ENDS END MAIN

;%ihY%#iGf b9riB%J@@J?

I

1
I

I

fib5lHtB.#ib,RrtB#rbflBQ#kd% AB 3 2 7 ?iBI 7-34 R!H 7-35. 326 7.14 @$TBE%s%Z% H%a&&t-% 3 A O H - 8 3 A 7 H , s @ a g % 8250 8 8088 &,E>%H2E%EIQ ?$;kH?AfiSiJk&&% 8 2 5 0 7i5%2?2%%iSB&,fiif;F%&~% BUFFER HlllR%1 0 0 B WB%,X%%2?S@Bo @: 8250 ~~~,#%IF,$%E%~~AIZI R8%SA%%B@#H%iS% 1-7-3 %ZO 96,
E!p
0060H.

D7

RESET

MR

DTR

;8250 ZXL%@JEi4k@J$ BEGIN : MOV DX 83A3 H MOV AL,80H OUT DX, AL MOV DX,83AOH MOV AL,6OH OUT DX, AL INC DX MOV AL,O
'

;%EB%J%6%&~
;d%E@%~%7?#L% D7=1

;RB+47?#&ht
;I%%% 0060H

;%%B% st!?

OUT DX ,AL MOV DX, 83A3H MOV AL,OAH OUT DX, AL M0.Y DX ,83A4 H MOV AL,03H OUT DX ,AL MOV DX,83AlH MOV AL,O OUT DX ,AL

;%EB& 6L 8
;BEWiH%77%B!ikt

fRti ilf

9 7

fGBB6L .$@&

;aMkBEE%l%e%
;MODEM @%l%77%B!ikt

;@ DTR j$ RTS G B

;%B%%@FF
SENDATA: LEA SI BUFFER MOV CX, 100 WAITT: MOV DX983A5H IN AL,DX TEST AL,2OH

JZWAITT
MOV DX, 83AOH MOV AL, [Sl] OUT DX ,AL INC SI DEC CX

JNZWAITT
7-15

kBq%%Hq%$%%WBB,g%SR%&BJHBBH6B@&

DATA
7

$n;H+'%YiBEi%F~@. @: BkB-#,E%ZX$8250 ZfiSf7@M&,#@M&@B%kBB$mB F ! BZR+%jifci$%G%H DOI3B"l". B@4m7;:
BEGIN :

...
MOV DX,83AlH MOV AL,OlH OUT DX ,AL ST1
;+%fci+*?-%%B!ikt

;fc?fB~%%%77%?&7&+%

;Btk%BT@E? RECDATA: PUSH AX PUSH BX PUSH DX PUSH DS MOV DX,83A5H IN AL ,DX MOV AH, AL

;%GB@%&

MOV DX, 83AOH IN AL,DX AND AL, 7FH TEST A H , 1EH

;i%h%%4k?Ab!1%%

;&ILE%%%%PLk

J-NZ ERROR
SAVEDATA : MOV DX, SEG DATA MOV DS, DX MOV S1,OFFSET DATA MOV [SI] ,AL MOV DX,+R@$Jtillt 8259 %U&& MOV AL, 2OH OUT DX, AL POP DS POP DX POP BX POP AX ST1 IRET

;E%+%%%&+%

8259


相关推荐

最新更新

猜你喜欢