您好,欢迎光临本网站![请登录][注册会员]  
文件名称: MPLAB C18编译器用户指南
  所属分类: 硬件开发
  开发工具:
  文件大小: 1mb
  下载次数: 0
  上传时间: 2014-09-18
  提 供 者: wuhenyo********
 详细说明: 第1 章 简介 1.1 概述.............................................................................................................. 7 1.2 调用编译器................................................................................................... 7 1.2.1 生成输出文件................................................................................................. 8 1.2.2 显示诊断信息................................................................................................. 8 1.2.3 定义宏............................................................... ............................................. 9 1.2.4 选择处理器..................................................................................................... 9 1.2.5 选择模式......................................................................................................... 9 第2 章 语法说明 2.1 数据类型及数值范围................................................................................... 11 2.1.1 整型.............................................................................................................. 11 2.1.2 浮点型.......................................................................................................... 11 2.2 字节存储顺序 — Endianness ................................................................... 12 2.3 存储类别..................................................................................................... 12 2.3.1 Overlay......................................................................................................... 12 2.3.2 static 型函数参数..................................................................................... 13 2.4 存储限定符................................................................................................. 14 2.4.1 near/far 数据存储对象............................................................................. 14 2.4.2 near/far 程序存储对象............................................................................. 14 2.4.3 ram/rom 限定符.......................................................................................... 14 2.5 包含文件搜索路径...................................................................................... 15 2.5.1 系统头文件................................................................................................... 15 2.5.2 用户头文件................................................................................................... 15 2.6 预定义宏名................................................................................................. 15 2.7 与ISO 的差异............................................................................................. 15 2.7.1 整型的提升................................................................................................... 15 2.7.2 数字常量....................................................................................................... 16 2.7.3 字符串常量................................................................................................... 16 2.7.4 stdio.h 函数.............................................................................................. 18 2.8 语言的扩展................................................................................................. 18 2.8.1 匿名结构....................................................................................................... 18 2.8.2 行内汇编....................................................................................................... 19 MPLAB® C18 C 编译器用户指南 DS51288J_CN 第iv 页 2005 Microchip Technology Inc. 2.9 Pragma 伪指令........................................................................................... 20 2.9.1 #pragma sectiontype ............................................................................20 2.9.2 #pragma interruptlow fname / #pragma interrupt fname....................................................................27 2.9.3 #pragma tmpdata [section-name].....................................................31 2.9.4 #pragma varlocate bank variable-name #pragma varlocate "section-name" variable-name ...................33 2.9.5 #pragma config .......................................................................................34 2.10 针对处理器的头文件.................................................................................. 36 2.11 针对处理器的寄存器定义文件.................................................................... 38 第3 章 运行时模型 3.1 存储模型.................................................................................................... 39 3.2 关于调用的约定.......................................................................................... 40 3.2.1 非扩展模式的约定.........................................................................................40 3.2.2 扩展模式约定................................................................................................41 3.2.3 返回值...........................................................................................................42 3.2.4 管理软件堆栈................................................................................................43 3.2.5 C 语言与汇编语言的混合编程.......................................................................43 3.3 启动代码.................................................................................................... 48 3.3.1 默认操作.......................................................................................................48 3.3.2 定制..............................................................................................................49 3.4 编译器管理的资源...................................................................................... 50 第4 章 优化 4.1 合并相同的字符串...................................................................................... 49 4.2 转移优化.................................................................................................... 50 4.3 存储区选择优化 ......................................................................................... 50 4.4 W 寄存器内容跟踪..................................................................................... 51 4.5 代码排序.................................................................................................... 51 4.6 尾部合并.................................................................................................... 52 4.7 删除执行不到的代码.................................................................................. 53 4.8 复制传递.................................................................................................... 53 4.9 冗余存储删除............................................................................................. 54 4.10 删除死代码................................................................................................. 55 4.11 过程抽象.................................................................................................... 55 第5 章 应用实例 5.1 应用程序:使用LED 和中断的嵌入式“Hello, World!”程序.................... 59 5.2 应用程序:创建大数据对象及读写USART................................................ 62 5.3 应用程序:使用EEDATA 和多个中断源.................................................... 67 目录  2005 Microchip Technology Inc. DS51288J_CN 第v 页 附录A COFF 文件格式 A.1 struct filehdr — 文件头.................................................................. 73 A.1.1 unsigned short f_magic..................................................................... 73 A.1.2 unsigned short f_nscns ...................................................................... 73 A.1.3 unsigned long f_timdat........................................................................ 73 A.1.4 unsigned long f_symptr........................................................................ 73 A.1.5 unsigned long f_nsyms.......................................................................... 73 A.1.6 unsigned short f_opthdr ..................................................................... 73 A.1.7 unsigned short f_flags........................................................................ 74 A.2 struct opthdr — 可选文件头............................................................... 74 A.2.1 unsigned short magic............................................................................ 74 A.2.2 unsigned long vstamp.......................................................................... 74 A.2.3 unsigned long proc_type ..................................................................... 75 A.2.4 unsigned long rom_width_bits........................................................... 76 A.2.5 unsigned long ram_width_bits........................................................... 76 A.3 struct scnhdr — 段头......................................................................... 77 A.3.1 union _s..................................................................................................... 78 A.3.2 unsigned long s_size............................................................................ 78 A.3.3 unsigned long s_scnptr........................................................................ 78 A.3.4 unsigned long s_relptr........................................................................ 78 A.3.5 unsigned long s_lnnoptr ..................................................................... 78 A.3.6 unsigned short s_nreloc ..................................................................... 78 A.3.7 unsigned short s_nlnno........................................................................ 78 A.3.8 unsigned long s_flags.......................................................................... 79 A.4 struct reloc — 重定位记录................................................................. 79 A.4.1 unsigned long r_vaddr.......................................................................... 79 A.4.2 unsigned long r_symndx........................................................................ 79 A.4.3 short r_offset........................................................................................ 79 A.4.4 unsigned short r_type.......................................................................... 80 A.5 struct syment — 符号表记录............................................................... 81 A.5.1 union _n..................................................................................................... 81 A.5.2 unsigned long n_value.......................................................................... 81 A.5.3 short n_scnum.......................................................................................... 82 A.5.4 unsigned long n_type............................................................................ 82 A.5.5 char n_sclass.......................................................................................... 83 A.5.6 unsigned char n_numaux....................................................................... 83 A.6 struct coff_lineno — 行号记录....................................................... 84 A.6.1 unsigned long l_srcndx........................................................................ 84 A.6.2 unsigned short l_lnno.......................................................................... 84 A.6.3 unsigned long l_paddr.......................................................................... 84 A.6.4 unsigned short l_flags........................................................................ 84 A.6.5 unsigned long l_fcnndx........................................................................ 84 A.7 struct aux_file — 源文件的附加符号表记录.................................... 84 A.7.1 unsigned long x_offset........................................................................ 84 A.7.2 unsigned long x_incline ..................................................................... 84 A.7.3 unsigned char x_flags.......................................................................... 85 MPLAB® C18 C 编译器用户指南 DS51288J_CN 第vi 页 2005 Microchip Technology Inc. A.8 struct aux_scn — 段的附加符号表记录.............................................. 85 A.8.1 unsigned long x_scnlen........................................................................85 A.8.2 unsigned short x_nreloc......................................................................85 A.8.3 unsigned short x_nlinno......................................................................85 A.9 struct aux_tag — struct/union/enum 标记名的附加符号表记录. 85 A.9.1 unsigned short x_size ..........................................................................85 A.9.2 unsigned long x_endndx........................................................................85 A.10 struct aux_eos — struct/union/enum 结束的附加符号表记录..... 86 A.10.1 unsigned long x_tagndx......................................................................86 A.10.2 unsigned short x_size ........................................................................86 A.11 struct aux_fcn — 函数名的附加符号表记录....................................... 86 A.11.1 unsigned long x_tagndx......................................................................86 A.11.2 unsigned long x_lnnoptr....................................................................86 A.11.3 unsigned long x_endndx......................................................................86 A.11.4 short x_actscnum..................................................................................86 A.12 struct aux_fcn_calls — 函数调用的附加符号表记录....................... 87 A.12.1 unsigned long x_calleendx................................................................87 A.12.2 unsigned long x_is_interrupt.........................................................87 A.13 struct aux_arr — 数组的附加符号表记录........................................... 87 A.13.1 unsigned long x_tagndx......................................................................87 A.13.2 unsigned short x_size ........................................................................87 A.13.3 unsigned short x_dimen[X_DIMNUM] ................................................87 A.14 struct aux_eobf — 块或函数结尾的附加符号表记录.......................... 88 A.14.1 unsigned short x_lnno ........................................................................88 A.15 struct aux_bobf — 块或函数开头的附加符号表记录......................... 88 A.15.1 unsigned short x_lnno ........................................................................88 A.15.2 unsigned long x_endndx......................................................................88 A.16 struct aux_var — struct/union/enum 类型变量的附加符号表记录................................................................................. 88 A.16.1 unsigned long x_tagndx......................................................................88 A.16.2 unsigned short x_size ........................................................................88 A.17 struct aux_field — 位域的附加记录.................................................. 89 A.17.1 unsigned short x_size ........................................................................89 附录B 采用ANSI 定义的方式 B.1 简介............................................................................................................ 91 B.2 标识符........................................................................................................ 91 B.3 字符............................................................................................................ 91 B.4 整型............................................................................................................ 92 B.5 浮点数........................................................................................................ 92 B.6 数组和指针................................................................................................. 93 B.7 寄存器........................................................................................................ 93 B.8 结构和联合................................................................................................. 93 目录  2005 Microchip Technology Inc. DS51288J_CN 第vii 页 B.9 位域............................................................................................................ 93 B.10 枚举............................................................................................................ 94 B.11 Switch 语句................................................................................................ 94 B.12 预处理伪指令............................................................................................. 94 附录C 命令行概述 附录D MPLAB C18 诊断 D.1 错误............................................................................................................ 97 D.2 警告.......................................................................................................... 109 D.3 消息.......................................................................................................... 112 附录E 扩展模式 E.1 源代码兼容性........................................................................................... 113 E.1.1 栈帧大小.................................................................................................... 113 E.1.2 static 型参数.......................................................................................... 113 E.1.3 overlay 关键字........................................................................................ 113 E.1.4 行内汇编.................................................................................................... 114 E.1.5 预定义宏.................................................................................................... 114 E.2 命令行选项差别........................................................................................ 115 E.3 COFF 文件差别........................................................................................ 115 E.3.1 一般处理器................................................................................................. 115 E.3.2 文件头的f_flags 字段............................................................................ 115 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: MPLAB C18 编译器
 输入关键字,在本站1000多万海量源码库中尽情搜索: