完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
下面是XC16编译器手册[DS5002071D页211 ]的摘录。这里P1被传递给W3:W2而不是W1:W2,为什么??
以上来自于百度翻译 以下为原文 The following is an excerpt from the xc16 compiler manual [DS50002071D-page 211]. params0(short p0, long p1, int p2, char p3, float p4, void *p5) { /* ** W0 p0 ** W1 p2 ** W3:W2 p1 ** W4 p3 ** W5 p5 ** W7:W6 p4 */ ... } Here p1 is passed to w3:w2 instead of w1:w2, why?? |
|
相关推荐
7个回答
|
|
它与存储器中的数据对齐有关,其中双字数据存储在两个连续的工作寄存器中,而偶数编号的工作寄存器中的最小有效字存储在两个连续的工作寄存器中。
以上来自于百度翻译 以下为原文 It has to do with data alignment in memory, where double word data is stored in two successive working registers with the least significant word in an even numbered working register. |
|
|
|
在这种情况下,我建议按大小递减的顺序进行排序——这将在w0:w1和w2:w3中传递longs。
以上来自于百度翻译 以下为原文 In such cases I recommend to sort in decending-size order - which would pass the longs in w0:w1 and w2:w3. Which is quite predictible. |
|
|
|
MAC W4*W5,A,[W8] +=2,W4,[W10] +=2,W5W4,W5应该只有int的吗?难道它们不能成为交易的吗?我知道这完全是离题,但相信答案是肯定或否定的,所以把它贴在这里而不是一个新的帖子。
以上来自于百度翻译 以下为原文 mac w4*w5,a,[w8]+=2,w4,[w10]+=2,w5 Does w4,w5 should be only int's?Can't they be _Fract's? I understand this is completely off-topic, but believe the answer is yes or no, so posting it here instead of a new post. |
|
|
|
“FrACT”只是对整数格式的另一种解释(无论是签名的还是未签名的、长的、短的或字节的)。因此,与整数格式一起工作的任何东西也适用于Fract。但您仍然需要知道签名/未签名,最终不同的FrACT解释…
以上来自于百度翻译 以下为原文 'Fract' is 'only' another interpretation of an integer format (whether signed or unsigned, long, short or byte). Thus anything working with integer formats works with Fract as well. But you still have to be aware about signed/unsigned and eventually different fract interpretations... |
|
|
|
看看你的DSPIC33任何数据表!对于我使用的所有方法,在CORCON中有一个位来确定底层整数乘法的结果是否将被移位以获得分数答案。事实上,我建议您在编写DSP代码之前检查所有CORCON。
以上来自于百度翻译 以下为原文 Look in your dsPIC33whatever Data Sheet! For all of them that I have used, there is a bit in CORCON that determines whether the result of underlying integer multiplications will be shifted so as to get the fractional answer. There are also bits in CORCON that determine whether overflows are pegged at saturated values rather than wrapping around. As a matter of fact, I would recommend that you inspect all of CORCON before writing DSP code. Regards, Dave |
|
|
|
就像杜所说的,这只是一个代表性的问题。以乘法0x4000*0x4000=0x10000000为例。在整数模式(IF位=1)中,它表示16384*16384=268435456。在分数Q15模式(IF位=0)中,结果左移1以将最高有效15位加上符号位放在上位单词中,乘法运算表示0.5*0.5=0.25(0x4000*0x4000=0x2000)。固定点DSP使用两个不同Q格式的补定点数。浓烟。
以上来自于百度翻译 以下为原文 Like DU said, it is just a matter of representation. Take the multiplication 0x4000 * 0x4000 = 0x1000 0000 as an example. In integer mode (IF bit = 1) it represents 16384 * 16384 = 268435456. In fractional Q15 mode (IF bit = 0), where the result is left shifted by one to put the most significant 15 bits plus the sign bit in the upper word, the multiply represents 0.5 * 0.5 = 0.25 (0x4000 * 0x4000 = 0x2000). Fixed-point DSPs use 2's complement fixed-point numbers in different Q formats. |
|
|
|
谢谢你们,在你们上面的引用之前,我做了一切可能的怪事。礼貌地询问:我想承认你们的两个答复作为回答,而不是把它们标记为有用的,但是论坛允许我只选择一个作为回答。怎么办?
以上来自于百度翻译 以下为原文 Thanks guys, I was doing all possible weird things before your above quotes. Polite enquiry: I want to acknowledge both your replies as answers instead of labeling them helpful, but the forum allows me to choose only one as answer. What to do? |
|
|
|
只有小组成员才能发言,加入小组>>
5228 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3199 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
770浏览 1评论
658浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
585浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
668浏览 0评论
570浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-18 13:15 , Processed in 1.463307 second(s), Total 91, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号