• 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: 請教有關PIC18F8620使用in line assemble的問題
#4
版主
版主


查看用戶資訊
有關 naer 的宣告是需使用 #progma udata access Stction_name 的方式宣告,你可以參考 教育訓練裡德 W401 workshop 教材裡面的第五章,說明的很詳細。

發表於: 2005/1/7 22:54
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請教有關PIC18F8620使用in line assemble的問題
#3
新會員
新會員


查看用戶資訊
可是當我宣告成near unsigned char xxxx compiler會出現以下的錯誤:
Error [1303] 'near' symbol defined in non-access qualified section

而C的變數並沒有指定是在那一個bank,在in line assemble裏面好像也不能使用banksel的假指令,如果要利用BSR是不是在C的時候就要把變數放在我知道的地方?

發表於: 2005/1/6 18:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請教有關PIC18F8620使用in line assemble的問題
#2
版主
版主


查看用戶資訊
建議一下,要再Assembly裡面用C所宣告的變數,最好是宣告成 near unsigned char xxxx 這樣就沒有Bank的切換問題。
建議下載右邊教育訓練裡的 W401 第七章詳讀一下那裡有講到如何使用 In-Line Assembly。

發表於: 2005/1/6 17:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請教有關PIC18F8620使用in line assemble的問題
#1
新會員
新會員


查看用戶資訊
請教一下我目前使用PIC18F8620來開發,但是在使用in line assemble的時候遇到了一些問題想請教一下。

unsigned char Asm_Variable; //宣告此為全域變數

void main (void)
{
_asm
movlw 10
movwf Asm_Variable,0
_endasm
如果我這麼寫的話,由Watch去看Asm_Variable的變數並沒有改變,所有的ram也都沒改變。

_asm
movlw 10
movwf Asm_Variable,1
_endasm
如果我改成這種寫法,由Watch去看Asm_Variable的變數也沒有改變,但是如果Asm_Variable的位址是放在0110h,則ram裏面的某個位址 xx10h會被寫入。

}

想請問一下為什麼?要用in line assemble讀寫C宣告的變數該怎麼做?

謝謝!

發表於: 2005/1/6 17:37
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... ]

教育訓練中心

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