《单片微型计算机原理及接口技术课后习题答案.pdf》由会员分享,可在线阅读,更多相关《单片微型计算机原理及接口技术课后习题答案.pdf(15页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、习题二2-1 试述 8051 单片机主要由哪几个部分构成?1.一个 8 位微处理器CPU 2.数据存储器RAM 和特殊功能寄存器3.内部程序存储器ROM 4.两个定时/计数器5.四个 8 位可编程的I/O 并行端口6.一个串行端口7.中断控制系统8.内部时钟电路2-2 MCS-51 单片机的片外总线是怎样构成的?试画出其结构示意图。1.片外总线构成:1)地址总线 AB 2)数据总线 DB 3)控制总线CB 2.结构示意图2-3 MCS-51 单片机四组并行IO 口在使用时各有什么特点?1.P0 口特点:1)作输出口使用时,由于输出驱动为漏极开路式,需外接上拉电阻,阻值一般为 510K.2)作输
2、入口使用时,在输入数据时,应先向端口写入”1”,使引脚处于悬浮状态,再读入数据.3)扩展 ROM 和(或)RAM 时,作为地址/数据总线使用(地址 A7A0,数据 D7D0)2.P1 口特点:1)作输出口使用时,无需外接上拉电阻(内部有上拉电阻)2)作输入口使用时,在输入数据时,应先向端口写入”1”,使引脚处于悬浮状态,再读入数据.3.P2 口特点:1)作输出口使用时,无需外接上拉电阻(内部有上拉电阻)2)作输入口使用时,在输入数据时,应先向端口写入”1”,使引脚处于悬浮状态,再读入数据.3)扩展 ROM 和(或)RAM 时,作为地址/数据总线使用(地址 A15A8,数据 D15D8)4.P3
3、 口特点:1)作输出口使用时,无需外接上拉电阻(内部有上拉电阻)2)作输入口使用时,在输入数据时,应先向端口写入”1”,使引脚处于悬浮状态,再读入数据.3)第二功能如下表文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:
4、CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E
5、10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V
6、3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K
7、5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L
8、7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P
9、7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U
10、42-4 MCS-51单片机的存储器有几个存储空间?各自的地址范围和容量是多少?使用时各有什么特点?四个存储空间:(不同的单片机有所不同)1.片内 RAM,地址范围:00HFFH,共 256 个字节1)00H1FH 为通用寄存器区,共分四组(0 组 1 组 2 组 3 组,由 PSW 的 RS1 RS0 决定,复位时自动选中0 组)每组 8 个寄存器 R0R7 2)20H2FH 为位寻址区,共 128 位(16*8)3)30H7FH 为通用 RAM 区,共 64 个字节4)80HFFH 为特殊功能寄存器(SFR)区,共 128 个字节并行口串行口中断系统定时/计数器等功能单元和状态寄存器等共2
11、1 个单元离散的分布在这个区中,其他空闲单元不能使用2.片外 RAM,地址范围:0000HFFFFH,共 64K 字节3.片内 ROM(EA=1),地址范围:0000H0FFFH,共 4K 字节4.片外 ROM(EA=0),地址范围:0000HFFFFH,共 64K 字节2-5 在单片机内RAM 中哪些字节有位地址?哪些字节没有位地址?特殊功能寄存器中安排位地址的作用何在?有位地址的字节:20H2FH 80H 88H 90H 98H A0H A8H B0H B8H D0H E0H F0H SFR 安排地址位的作用:可按位访问,方便使用2-6 什么叫振荡周期、时钟周期、机器周期和指令周期?振荡周
12、期-为单片机提供时钟信号的振荡源的周期时钟(状态)周期-振荡源信号经二分频后形成的时钟脉冲信号机器周期-完成一个基本操作所需的时间,由 6 个时钟(状态)周期组成指令周期-CPU 执行一条指令所需的时间时钟(状态)周期=2 振荡周期机器周期=6 时钟(状态)周期=12 振荡周期指令周期=1 个或 2 个或 4 个机器周期2-7 若单片机使用的晶振为6MHz,那么振荡周期、机器周期和指令周期分别是多少?fosc=6MHZ T 振荡=1/fosc=0.167s 文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H
13、6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU
14、2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W
15、9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编
16、码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H
17、9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U1
18、0V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE
19、9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4T 机器=12*T 振荡=2s T 指令=(14)T 机器=28s 2-8 当单片机使用的晶振为12MHz 时,执行一条指令所需的最长时间为多少?fosc=12MHZ T 指令=14s TMAX指令=4s 2-9 说出单片机复位后,各特殊功能寄存器的初始化状态是什么各特殊功能寄存器的初始化状态如表特别 S
20、P=07H,P0P3=FFH 注意:复位后要先给SP 赋值(30H7FH),P0P3 置初值习题三3-1 说明下列各条指令划线部分的寻址方式,并用图说明指令实现的操作。(1)ADD A,30H;直接寻址(2)MOVX A,DPTR;寄存器间接寻址(3)MOVC A,A+PC;变址寻址(4)ORL 60H,#22H;直接寻址立即寻址(5)MOV R1,A;寄存器间接寻址3-2 查附录写出下列各条指令的机器码。ACALL 0100H;3100 文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7
21、H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4
22、文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:C
23、E3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E1
24、0U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3
25、 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5
26、C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7
27、 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4LCAlL 0300H;120300 AJMP 0100H;2100 LJMP 0300H;D20300 SJMP 5;80FB SJMP$十 5;8003 3-3 设 R0=7EH,DPTR=10FEH,片内RAM中 7EH、7FH 单元内容为0AAH、0BBH,试分析下列每条指令、增加注释并写出其执行结果。INC R0
28、;(7EH)+1 7EH,(7EH)=0ABH 1NC R0;R0+1 R0,(R0)=7FH 1NC R0;(7FH)+1 7FH,(7FH)=0BCH 1NC DPTR;DPTR+1 DPTR DPTR=10FFH 3-4 若 A=80H,R0=17H,(17H)=34H,执行下段程序后,A=?ANL A,#17H;A=0 ORL 17H,A;A=0(17H)=34H XRL A,R0;A=34H CPL A;A=0CBH 3-5 说明下段程序执行过程中,SP 的内容以及堆栈中内容的改变过程。MOV SP,#20H;SP=20H MOV A,#20H;A=20H MOV B,#30H;B=
29、30H PUSH ACC;SP+1 SP=21H,(21H)=20H PUSH B;SP+1 SP=22H,(22H)=30H POP ACC;(22H)A,SP-1 SP=21H POP B;(21H)B,B=20H,SP-1 SP=20H 3-6 有程序如下:CLR RS1;位操作RS1=0 CLR RS0;位操作RS0=0 MOV A,#38H;字节操作A=38H MOV R0,A;字节操作R0=38H MOV 29H,R0;字节操作(29H)=38H SETB RS0;位操作RS0=1 MOV C,RS0;位操作C=RS0=1 MOV R1,A;字节操作R1=A=38H 文档编码:CE
30、3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10
31、U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3
32、HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C
33、8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7
34、ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H
35、3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文
36、档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4MOV 26H,A;字节操作(26H)=A=38H MOV 28H,C;位操作(28H)=C=1 ADDC A,26H;字节操作 A+(26H)+C A=71H 试问:(1)区分哪些
37、是位操作指令?哪些是字节操作指令?(2)写出程序执行后有关寄存器和RAM 中有关单元的内容。3-7已知(61H)=0F2H,(62H):0CCH。说明下面程序功能,写出涉及的寄存器及片内RAM 单元的最后结果。MOV A,#61H;A=61H MOV B,#02H;B=02H DIV AB;A/B=A(商)=30H B(余数)=01H ADD A,62H;A+(62H)A=0FCH(C=0)MOV 63H,A;A(63H)=0FCH CLR A;A=0 ADDC A,B;A+B+C A=01H MOV 64H,A;A(64H)=01H 3-8说明下面程序功能,在括号中填出所缺的机器码。0020
38、 78 ADRl:MOV RO,#ADRl 0022(79)ADR2:MOV R1,#ADR2 0024 7A Ll:MOV R2,#LL 0026 C3 CLR C 0027 E6 LOOP:MOV A,R0 0028 37 ADDC A,R1 0029 F6 MOV R0,A 002A 08 1NC R0 002B 09 1NC Rl 002C DA(F9)DJNZ R2,LOOP 002E 80(FE)SJMP$功能:LL 个字节的加法被加数放在ADRl 为首的单元内加数放在 ADR2 为首的单元内低字节放在低地址单元结果放在被加数单元文档编码:CE3H9E10U10V3 HE9K5C8
39、H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 Z
40、U2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3
41、W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档
42、编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3
43、H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U
44、10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 H
45、E9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U43-9试编程将片外数据存储器1000H 单元中的数据与片内RAM 中 30H单元中的内容互换程序如下:MOV 31H,30H MOV DPTR,#1000H MOVX A,DPTR MOV 30H,A MOV A,31H
46、 MOVX DPTR,A SJMP$习题四4-1 两个 4 位 BCD 码数相加,设被加数和加数分别存于片内RAM 的 40H、41H 和 45H46H 单元中,和数存于50H、51H 单元中(均是低位在前,高位在后),试编写程序。根据题意,最高位将不产生进位(或不考虑)ORG 0000H LJMP START ORG 0200H START:MOV A,40H ADD A,45H;低位相加DA A ;BCD 调整MOV 50H,A;存和低位MOV A,41H ADDC A,46H;高位带进位位相加DA A ;BCD 调整MOV 51H,A;存和高位SJMP$END 4-2 已知片外RAM 中
47、 2100H 单元中存有一有符号整数。试编写程序,求该单元数据的绝对值。ORG 0000H LJMP START 文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU
48、2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W
49、9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编
50、码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H9E10U10V3 HE9K5C8H6L7 ZU2P7H3W9U4文档编码:CE3H