• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: MPLAB-C18 或 CCS C 是否有這個功能?
#3
版主
版主


查看用戶資訊
Microchip 的 C18 的名稱應該是 Optimum ANSI C compiler for PIC18Fxxxx, 這只是最佳化(Optimization)的功能,如果你在 MPLAB IDE 下使用 MPLAB C18 的話,基本上你有11種最佳化的設定選項。
你可以在設定好 Language Tools 為 C18 後,點選"Project --> Build Options --> Project" 再選擇 C18 內的 Categories 裡將 Optimization 功能打開就可以了。

不過給個建議 : 一般在寫 C 程式時最好先不要將Optimization功能打開,因為你一打開就如 x8051 先生所講的會有一些想不到的問題發生,最好是等程式功能已完成後在一項一項的打開Optimization。這樣發生了問題也會比較好解決。

一些特殊的變數你也可以加入 volatile 的宣告以確保這些變數不做最佳化的處理,例如: 週邊暫存器。

發表於: 2004/9/2 22:38
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB-C18 或 CCS C 是否有這個功能?
#2
資深會員
資深會員


查看用戶資訊
CCS-C:

看 Help 就有啦

#OPT

Syntax:
#OPT n

Elements:
n is the optimization level 0-9

Purpose:
The optimization level is set with this directive. The directive applies to the entire program and may appear anywhere in the file. Optimization level 5 will set the level to be the same as the PCB,PCM,PCH stand-alone compilers. The PCW default is 9 for full optimization. This may be used to set a PCW compile to look exactly like a PCM compile for example. It may also be used if an optimization error is suspected to reduce optimization

發表於: 2004/9/2 20:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


MPLAB-C18 或 CCS C 是否有這個功能?
#1
高級會員
高級會員


查看用戶資訊
Keil C 程式碼最佳化!! 縮小程式的 CODE!!
優點:
反組譯也很難看的懂!!
缺點:
會影響速度!!

縮圖

發表於: 2004/9/2 2:46
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------