《微机原理及接口技术》典型习题参考答案1第2章2.14,2.27,2.40,2.46,2.49,2.52第5章5.10,5.14,5.17,第6章6.2,6.10,6.12,6.14第7章7.9,7.11第10章10.4,10.5第2章2.9(1)读操作占一次总线周期(4个时钟+1个时钟的等待周期)共5个时钟周期每个时钟周期=1/4MHz=0.25us,所以共需要0.25us*5=1.25us(2)复位至少需要4个时钟周期,4*0.25us=1us复位后内部除CS=FFFFH外,其它寄存器清0。第一条指令的地址FFFF0H2.10T1:地址锁存T2:地址撤销,准备数据T3:数据稳定到总线上T4:读写总线上的数据T1T2T3TwT4CLKM/IOA19-A16IOAD15-AD0OBHE12340H98HALEWRDT/RDENREADY2.14(1)数据段首地址DS*16=01500H,堆栈段首地址=SS*16=02500H,所以数据段中存放信息不能与堆栈段重合,故数据段末地址=0250H-1=024FFH即数据段范围:01500H~024FFH,4K字节(2)堆栈段末地址=SS*16+SP=02500H+1200H=03700H大小为1200H字节=4608字节,可存放16位的字4608/2=2304个(3)代码段由于下限没有其它限制,故最大64KB首地址=06400H,末地址=06400H+64KB-1=06400H+FFFFH=163FFH所以代码段地址范围:06400H~163FFH(4)11F4H。现在SP=0300H,则原来SP+12=0300H+0CH=030CH《微机原理及接口技术》典型习题参考答案22.40处理器主要参数80888086802868038680486PentiumPentiumProPentiumIIPentiumIIIPentium4通过寄存器位数16161632323232323232段寄存器位数16161616161616161616外部数据线条数8161632326464646464外部地址线条数20202432323236363636存储器空间1MB1MB16MB4GB4GB4GB64GB64GB64GB64GB寻址范围0~FFFFFH0-FFFFFH0-FFFFFFH0~FFFFFFFFH0~FFFFFFFFH0~FFFFFFFFH0~FFFFFFFFFH0~FFFFFFFFFH0~FFFFFFFFFH0~FFFFFFFFFH有符号数表示范围-215~215-1-215~215-1-215~215-1-231~231-1-231~231-1-231~231-1-231~231-1-231~231-1-231~231-1-231~231-1注:数的表示范围仅与内部通用寄存器的位数(字长)有关,与外部数据线条数无关。2.46(1)G=0:段界以字节为单位地址范围:089C0000H~089C003FH大小为3FH+1=40H=64,可容纳64/2=32个汉字(2)G=1:段界以4K字节为单位LIMIT=Limit×4K+0FFFH=0003FH×4K+0FFFH=40H×4K-1段大小=LIMIT+1=40H×4K=40000H段的末地址=089C0000H+40000H–1=089FFFFFH注:书上P.64例题的结果为0048FFFFH。2.48(1)DS*16+EAX=20000H+00003000H=00023000H(2)DS*16+ESI=1A000H+00002000H=0001C000H(3)SS*16+ESP=C0000H+0000A000H=000CA000H(4)DS*16+EDI=12390H+0000A000H=0001C390H2.49(1)访问权=11110010B=F2H,段基地址=03000000H,段界=末地址-首地址=1FFFH10000H所以G=0,D=1,AVL=1,段描述符=0350F20000001FFFH(2)访问权=11110010B=F2H,段基地址=01000000H,段界=末地址-首地址=01800FFF10000H,所以G=1,D=1,AVL=1,段界=大小/4K=1800H=1800H段描述符=01D0F20000001800H2.51(1)DS=0000000000001011B选中(TI=0)GDT表GDTR=001000001FFFH,GDT首地址=00100000H,段描述符界=1FFFH,可容纳8KB,因此可放8KB/8=1K个描述符。(2)段描述符首地址=00100000H+1*8=00100008H,段描述符=0240F210000003FFH段首地址=02100000H,段界=03FFH,所以末地址=021003FFH段的地址范围:02100000H~021003FFH《微机原理及接口技术》典型习题参考答案3(3)物理地址=段基地址+偏移地址=02100000H+00000002H=02100002H(4)EAX中的内容为02100002开始的4个字节,故EAX=32303031H(5)可从段描述符的应该说访问权字节及选择子分析:RPL=11,访问权=F2H=11110010B,该段是用户访问的存在物理存储器中的未被访问过的向上增长的可写数据段。2.52(1)CR0=60000010H,PG=0,PE=0为实地址方式,所以:物理地址=10030H+1230H=11260H,EAX=75392A00H(2)CR0=60000011H,PG=0,PE=1分段的保护方式,所以:段描述符首地址=0+1000H=00001000H,段描述符=0040F20100001FFFH段基地址=00010000H,物理地址=00010000H+1230H=00011230HEAX=32303034H段大小=段界+1=1FFFH+1=2000H,可容纳8KB数据,访问权=F2=11110010H,该段是存在物理存储器中的未被访问过的向上增长的可写数据段。(3)CR0=E0000011H,PG=1,PE=1分段且分页的保护方式,但线性地址已经给出:线性地址=00000004H,页目录索引=0页索引=0CR3=00001000H,页目录描述符首地址=00010000H,页描述符=00001FFFH所以页表基地址=00001000H,页描述符首地址=00010000H,页描述符=00001FFFH所以页基地址=00001000H,物理地址=00010000H+4H=00010004H第5章5.4SRAM引脚考虑(1)数据线条数(2)地址线条数(3)读信号和写控制信号、片选信号条数(4)电源,地线8K*8表明,地址线条数=log28K=log2213=13条,数据线8条,读写信号线1条,片选项1条,电源和地2条,共计25条,但为了成对,因此至少26条引脚。5.108K*8=213*8,ROM首地址=末地址-大小+1=5800H-8K+1=5800H-1FFFH=3801H16KB=214*8,末地址=RAM首地址+大小-1=5801H-3FFFH=9800H5.12由图知,地址线m=16,数据线=8条,容量=2m*n=216*8=64KB(实际为27512)5.14需要8K*8/(2K*4)=8片,2片一组进行位扩展,然后对4组进行字扩展,即采用字位全扩展方法。D7~D4D11~D8D15~D12A13A12M/IOE2-4译码器A0MWTCBHEHWRLWRD15~D12D11~D8D7~D4Y0Y1A11~A1(I)(II)(III)(IV)D15~D0CSD3~D0WEOEA10~A0CSD3~D0WEOEA10~A0CSD3~D0WEOEA10~A0CSD3~D0WEOEA10~A0D3~D0CSD3~D0WEOEA10~A0D3~D0CSD3~D0WEOEA10~A0CSD3~D0WEOEA10~A0CSD3~D0WEOEA10~A0MRDC《微机原理及接口技术》典型习题参考答案4地址范围:(I):Y0=0:A13A12=00,A11~A1从全0到全1变化,但A0=0,所以范围:0000H~0FFEH(全为偶地址),共2KB(II):Y0=0:A13A12=00,A11~A1从全0到全1变化,但A0=1,所以范围:0001H~0FFFH(全为奇地址),共2KB(III):Y1=0:A13A12=01,A11~A1从全0到全1变化,但A0=0,所以范围:1000H~1FFEH(全为偶地址),共2KB(IV):Y1=0:A13A12=01,A11~A1从全0到全1变化,但A0=0,所以范围:1001H~1FFFH(全为奇地址),共2KB5.17题图改动:M/IO加一非门后再接G2B。(1)地址:1#(Y0=0)A19A18A17A16A15=10000,A14~A0全0到全1变化所以以范围:80000H~87FFFH2#(Y1=0)A19A18A17A16A15=10001,A14~A0全0到全1变化所以以范围:88000H~8FFFFH3#(Y2=0)A19A18A17A16A15=10010,A14~A0全0到全1变化所以以范围:90000H~97FFFH4#(Y3=0)A19A18A17A16A15=10011,A14~A0全0到全1变化所以以范围:98000H~9FFFFH5#(Y4=0)A19A18A17A16A15=10011,A14~A0全0到全1变化所以以范围:98000H~9FFFFH6#(Y5=0)A19A18A17A16A15=10101,A14~A0全0到全1变化所以以范围:A8000H~AFFFFH7#(Y6=0)A19A18A17A16A15=10110,A14~A0全0到全1变化所以以范围:B0000H~B7FFFH(2)MOVAX,9800H;4#首地址98000H,取段地址9800H偏移地址0MOVDS,AXMOVSI,0MOVCX,1024*2;2KBMOVAX,0B000H;7#首地址0B0000H,取段地址B000H,偏移地址0MOVES,AXMOVDI,0CLD;DF=0REPMOVSB;串操作或MOVAX,9800H;4#首地址98000H,取段地址9800H偏移地址0MOVDS,AXMOVSI,0MOVCX,1024*2;2KBMOVAX,0B000H;7#首地址0B0000H,取段地址B000H,偏移地址0MOVES,AXMOVDI,0LP1:MOVAL,[SI]MOV[DI],AL《微机原理及接口技术》典型习题参考答案5INCSIINCDILOOPLP1第6章6.2(a)A9A8A7A6A5A4A3A2A1A0=0001111111=7FH(b)A9A8A7A6A5A4A3A2A1A0=1001010XXX所以地址:250H~257H6.6MOVAL,80H;设置波特率MOVDX,373H;A1A0=11的地址(线路控制寄存器)OUTDX,ALMOVAL,30;1843200/(38400*16)除数MOVDX,370HOUTDX,AL;写除数低字节MOVAL,0INCDXOUTDX,AL;写除数高字节MOVAL,00010010BMOVDX,3F3HOUTDX,AL6.7MOVAL,80HMOVDX,3FBHOUTDX,ALMOVAL,10H;波特率7200的除数值=10HMOVDX,3F8HOUTDX,ALINCDXMOVAL,0OUTDX,ALMOVAL,00000011BMOVDX,3FBHOUTDX,ALSEND:MOVDI,OFFSETTRANSMOVCX,WORDPTRTLENGTH+4MOVSI,OFFSETTRANS-2MOVBYTEPTR[DI-2],55HMOVBYTEPTR[DI-1],0AAHMOVAX,DIADDAX,WORDPTRTLENGTHMOVDI,AXMOVBYTEPTR[DI+1],0AAH《微机原理及接口技术》典型习题参考