• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






Re: dspic中的 frame pointer 是要做何用
#8
中級會員
中級會員


查看用戶資訊
我做實驗的結果是在C程式中呼叫某一函數後,翻成組合語言一看會自動LNK數個byte的大小,此大小剛好就是被呼叫函數中所有的區域變數(包含參數),但是除了遞迴之外是否還有其他的用途?或是就是為了C語言所做出來的功能呢?

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


Re: dspic中的 frame pointer 是要做何用
#7
版主
版主


查看用戶資訊
1、聽我同事做實驗後說,在C程式中,呼叫某一函數後,W14及W15都會被牽動到。

2、我想,還可以利用它,甚至在使用組合語言時,都可以做到自已呼叫自已,類似所謂「遞迴」的寫法;其中使用W14來指到每一層函數中的變數。

發表於: 2004/12/1 23:55
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic中的 frame pointer 是要做何用
#6
中級會員
中級會員


查看用戶資訊
那這個東西通常都是怎麼用的啊?這個臨時性的空間到底有什麼用途呢?是不是像是C語言函數中的『區域變數』啊?

發表於: 2004/11/30 14:29
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic中的 frame pointer 是要做何用
#5
版主
版主


查看用戶資訊
1. W14 can be used as a stack frame pointer (FP)
2. LNK #N ; Allocates (N-2)/2 words of local storage
- W14 (prior stack FP) is stacked; W15 is incremented
- W15 value saved in W14 (new FP, start of local storage)
- W15 advanced by N/2 words (end of local storage + 1 word) (i.e. N must be an even number to keep stack word aligned)
- [W14 + y] accesses local storage for function call where: 0 <= y <= N-2
- W14 with a -ve offset accesses parameters from calling routine
3. ULNK ; De-allocates temporary storage space
- Restores W14 (start of local storage) to W15
- W15 decremented then stack popped into W14 (prior stack FP).

發表於: 2004/10/1 16:57
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic中的 frame pointer 是要做何用
#4
版主
版主


查看用戶資訊
假設您跳到了某一個副程式,此時,W15 (堆疊指標)會指到下一個可用的位置 ( 以byte為單位)。
如果此時您下了LNK #0x4 這個指令的話,會發生以下的事情:
1、W14的值會先被存在堆疊中,W15指到下一個可用的位置,亦即W15+2-> W15
2、接著,W14會等於新的W15的值。
3、然後,W15+4-> W15
也就是說,您可以利用LNK #0X4,在堆疊區開出4個BYTE的,通常是暫時性的,儲存空間。

發表於: 2004/10/1 16:40
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dspic中的 frame pointer 是要做何用
#3
初級會員
初級會員


查看用戶資訊
不知能否舉個簡單例子,說明frame pointer的用法

謝謝!

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


Re: dspic中的 frame pointer 是要做何用
#2
新會員
新會員


查看用戶資訊
frame pointer是用来为所调用的子程序的临时变量分配存储空间的。
LNK和ULNK是用来开始创建 STACK FRAME和结束STACK FRAME的,经常能用到的。

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


dspic中的 frame pointer 是要做何用
#1
初級會員
初級會員


查看用戶資訊
請問dspic中的 frame pointer 是要做何用?

要如何使用呢?

它和 lnk 及 ulnk 有關係?

發表於: 2004/9/4 9:59
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... ]

教育訓練中心

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