Re: PIC24H 除法讀值錯誤
|
||||
---|---|---|---|---|
初級會員
|
原來要加判斷OV旗號~了解 3Q~
發表於: 2009/12/31 13:35
|
|||
|
Re: PIC24H 除法讀值錯誤
|
||||
---|---|---|---|---|
資深會員
|
引述 dspic reference manual 的一段,24f 應該差不多:
This instruction must be executed 18 times using the REPEAT instruction (with an iteration count of 17) to generate the correct quotient and remainder. The N flag will be set if the remainder is negative and cleared otherwise. The OV flag will be set if the divide operation resulted in an overflow and cleared otherwise. The Z flag will be set if the remainder is ‘0’ and cleared otherwise. The C flag is used to implement the divide algorithm and its final value should not be used. 簡單地說, 1)叫你用組語去搞! 2)花時間,別call。 ……退一百步地說,使用別人寫好的lib應該不錯,可以找找有沒有?
發表於: 2009/12/29 0:23
|
|||
The Answer to Life, the Universe, and Everything.
|
||||
|
Re: PIC24H 除法讀值錯誤
|
||||
---|---|---|---|---|
初級會員
|
我知道商值最大=FFFFh,但如果數值如下(或類似),我該如何處理?
被除數=0001 0000h 除數=0001h 我要如何判斷不能這樣除,否則的得到的是錯誤商值~
發表於: 2009/12/28 23:05
|
|||
|
Re: PIC24H 除法讀值錯誤
|
||||
---|---|---|---|---|
版主
|
參照:
請把錯誤的訊息整個貼上來,我不曉得你的意思。
發表於: 2009/12/21 15:18
|
|||
|
Re: PIC24H 除法讀值錯誤
|
||||
---|---|---|---|---|
版主
|
參照:
商值大於FFFFh? 32bit/16bit 最大值就只到 0xFFFF 而已。不明瞭你的問題所在。
發表於: 2009/12/21 15:16
|
|||
|
Re: PIC24H 除法讀值錯誤
|
||||
---|---|---|---|---|
初級會員
|
附帶一點:asm30組譯時出現"pic30-coff-as.exe發生錯誤........" 無法組譯,這是什麼問題?
發表於: 2009/12/18 15:39
|
|||
|
PIC24H 除法讀值錯誤
|
||||
---|---|---|---|---|
初級會員
|
我在設計程式中,使用到32bit/16bit除法時發現,當商值大於FFFFh時,WREG0讀到的商值就是錯誤的,我該如何解決這個問題,煩請版大址點一下迷津~~謝謝!!
發表於: 2009/12/18 15:28
|
|||
|