Re: 請問inline assembly中的goto指令最大可跳躍範圍?
|
||||
---|---|---|---|---|
新會員
|
試了一下,果然加了(unsigned long),問題就解決了,感謝協助。
發表於: 2008/4/21 0:36
|
|||
|
請問inline assembly中的goto指令最大可跳躍範圍?(問題已解決)
|
||||
---|---|---|---|---|
新會員
|
使用的mplab c30 v3.02c, mplab ide v8.02,CPU為PIC24FJ64GA004:
#define APP_CodeAddr 0xA000 #define JMP_AppCode(PROG_ADDR) asm volatile ("goto %0" : /*no outputs*/ : "i"(PROG_ADDR)) int main(void){ . . JMP_AppCode(APP_CodeAddr); . . } 上面的code只要一經過編譯,就會出現下列的訊息 C:\DOCUME~1\DANIEL~1\LOCALS~1\Temp/cc1BRNpz.s: Assembler messages: C:\DOCUME~1\DANIEL~1\LOCALS~1\Temp/cc1BRNpz.s:16158: Error: Absolute address must be greater than or equal to 0. 但是只要把APP_CodeAddr 改成0x7000就沒問題,改成0x8000就又出現了上面的錯誤.我有查過instruction set,裡面列出goto這個指令的跳躍範圍,"GOTO lit23",0xA000沒有超出這個範圍,請問有什麼解決方式。另外一定會有人問我為什麼要這麼做,因為上面的程式片斷是一個bootloader要跳躍至application code,而那個application code的起始位址就是0xA000
發表於: 2008/4/17 22:45
|
|||
|