10.07.2015 Views

MPLAB® C30 C 编译器用户指南

MPLAB® C30 C 编译器用户指南

MPLAB® C30 C 编译器用户指南

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MPLAB ® <strong>C30</strong> 用 户 指 南C.10 匿 名 结 构MPLAB C18 支 持 非 ANSI 的 联 合 内 匿 名 结 构 。MPLAB <strong>C30</strong> 不 支 持 匿 名 结 构 。C.11 快 速 存 取 存 储 区dsPI<strong>C30</strong>F 器 件 没 有 快 速 存 取 存 储 区 。C.12 行 内 汇 编MPLAB C18 使 用 非 ANSI 的 _asm 和 _endasm 来 标 识 行 内 汇 编 程 序 块 。MPLAB <strong>C30</strong> 使 用 非 ANSI 的 asm, 它 看 起 来 很 像 函 数 调 用 。MPLAB <strong>C30</strong> 中 asm 语 句 的使 用 在 第 8.4 节 “ 使 用 行 内 汇 编 ” 中 详 述 。C.13 PRAGMA 伪 指 令MPLAB C18 使 用 pragma 伪 指 令 来 声 明 段 (code、 romdata、 udata 和 idata)、中 断 ( 高 优 先 级 和 低 优 先 级 ) 和 变 量 分 配 ( 存 储 区 、 段 )。MPLAB <strong>C30</strong> 使 用 非 ANSI 的 属 性 , 不 使 用 pragma 伪 指 令 。表 C-5:例 C-4:MPLAB C18 PRAGMA 伪 指 令 和 MPLAB <strong>C30</strong> 属 性Pragma (MPLAB C18) 属 性 (MPLAB <strong>C30</strong>)#pragma udata [name] __attribute__ ((section ("name")))#pragma idata [name] __attribute__ ((section ("name")))#pragma romdata [name] __attribute__ ((space (prog)))#pragma code [name]__attribute__ ((section ("name"))),__attribute__ ((space (prog)))#pragma interruptlow __attribute__ ((interrupt))#pragma interrupt__attribute__ ((interrupt, shadow))#pragma varlocate bank NA*#pragma varlocate name NA**dsPIC 器 件 存 储 器 不 分 区 。指 定 未 初 始 化 变 量 位 于 数 据 存 储 器 中 的 用 户 段C18: #pragma udata mybssint gi;<strong>C30</strong>: int __attribute__((__section__(".mybss"))) gi;例 C-5:将 变 量 MABONGA 分 配 到 数 据 存 储 器 中 的 地 址 0X100C18: #pragma idata myDataSection=0x100;int Mabonga = 1;<strong>C30</strong>: int __attribute__((address(0x100))) Mabonga = 1;DS51284C_CN 第 156 页© 2005 Microchip Technology Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!