• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   2 Anonymous Users






Re: 請問指令retfie s的三個暫存器要如何使用?
#5
新會員
新會員


查看用戶資訊
謝謝你的回應~~我了解了
但是你所提供的路徑我沒有耶~~
請問要到那下載安裝呢?

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


Re: 請問指令retfie s的三個暫存器要如何使用?
#4
版主
版主


查看用戶資訊
先說你是用組合語言吧! 因為使用組合語言需考慮到低優先權中斷的處理,你可以參考 Microchip 所提供的範例:

C:\Program Files\Microchip\MPASM Suite\Template\Code
;******************************************************************************
;
Low priority interrupt vector and routine
This code will start executing when a low priority interrupt occurs.
This code can be removed if low priority interrupts are not used.

        
ORG    0x0018

        movff    STATUS
,STATUS_TEMP    ;save STATUS register
        movff    WREG
,WREG_TEMP        ;save working register
        movff    BSR
,BSR_TEMP        ;save BSR register

;    *** low priority interrupt code goes here ***


        
movff    BSR_TEMP,BSR        ;restore BSR register
        movff    WREG_TEMP
,WREG        ;restore working register
        movff    STATUS_TEMP
,STATUS    ;restore STATUS register
        retfie

發表於: 2005/12/28 18:03
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問指令retfie s的三個暫存器要如何使用?
#3
新會員
新會員


查看用戶資訊
謝謝你的回應!!
照你的說法...那通常的用法是不是
低優先權使用軟體的堆疊來處理
而高優先權則使用shadow registers呢?

謝謝!!

發表於: 2005/12/28 16:54
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問指令retfie s的三個暫存器要如何使用?
#2
管理員
管理員


查看用戶資訊
你好,

基本在進入中斷向量位址之前 , CPU 已經自動的將 W , STATUS and BSR 儲存至 Shadow Registers 了 ! 所以使用鍺要在返回時用 retfie FAST 或 retfie 1 就可以了 .

針對低優先權的中斷 , 我們通常不用 Shadow Registers . 因為它可能會被高優先權的中斷搶走執行權. 故一般我們都用軟體的堆疊來處理 W , STATUS and BSR 的 push 問題 .

Thanks & Regards,

發表於: 2005/12/28 12:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問指令retfie s的三個暫存器要如何使用?
#1
新會員
新會員


查看用戶資訊
如題,指令retfie s的s如果設成1
則中斷回去時會同時將影子暫存器
WS,STATUSS,BSRS
丟回到
WREG,STATUS,BSR

但要如何設定在中斷開始時自動將
WREG,STATUS,BSR
丟到影子暫存器中呢?
謝謝!!

發表於: 2005/12/27 15:45
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... ]

教育訓練中心

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