完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
当目标存储器块位于零页面时,该地址通常从0x0到0xff。例如,如果目标存储器起始地址是0x0,则memory()将内容从0x100复制到地址。 memory()反汇编指令如:
LDW X,& sharpLength 循环:LD A,(scr + X) LD(dst + X),A DECW X. JRNE循环 RET'scr'和'dst'的值是存储块起始地址1之前的地址。例如如果memcpy()的'destination parameter'的起始地址是0x80,那么'dst'应该是0x7f,如果它的起始地址是0x0,'dst'将是0xff,那么内容将复制到内存从0x100。 我认为这应该是一个编译器问题。 #stm8-assembly #memcpy 以上来自于谷歌翻译 以下为原文 When the destination memory block is locate in zero page which the address is often rang from 0x0 to 0xff. For instance, if a destination memory start address is 0x0, the memory() will copy the contents to address from 0x100. The memory() disassembly instructions like: LDW X, &sharpLength loop: LD A, (scr + X) LD (dst + X), A DECW X JRNE loop RETThe value of 'scr' and 'dst' is the address before 1 of start address of memory block. e.g. If the start address of 'destination parameter' of memcpy() is 0x80, then the 'dst' should be 0x7f, and if the start address of it is 0x0, the 'dst' will be 0xff, then the contents will copy to the memory from 0x100. I thinks this should be a compiler issue. #stm8-assembly #memcpy |
|
相关推荐
3个回答
|
|
你好,
什么编译器? 请发布一个显示问题的最低C代码,以便我们可以重现它。 问候, 卢卡 以上来自于谷歌翻译 以下为原文 Hello, what compiler? Please post a minimum C code that shows the problem so that we can reproduce it. Regards, Luca |
|
|
|
嗨卢卡,
附加的stvd演示项目和捕获图像描述了在我的环境中运行的结果。 环境: Win10 STVD:版本4.3.10 宇宙:CxSTM8 4.3.5 以上来自于谷歌翻译 以下为原文 Hi Luca, Attached stvd demo project, and a capture image descripts the result of running in my environment. Environment: Win10 STVD: version 4.3.10 Cosmic: CxSTM8 4.3.5 |
|
|
|
你好,
编译器使用地址0来指示NULL指针值,这意味着有一些事情你无法用它来做,包括使用memcpy。 我建议在你的数组之前声明另一个变量,这样它就不再从0开始了,你可以以任何你想要的方式安全地访问它,但是如果你绝对需要在地址0使用memcpy你可以编写自己的版本它并使用它而不是默认的。 问候, 卢卡(宇宙) 以上来自于谷歌翻译 以下为原文 Hello, the address 0 is used by the compiler to indicate the NULL pointer value, and that implies that there are a few things you cannot do with it, including using memcpy. I would suggest to declare another variable before your array, so that it does not start at 0 anymore and you can access it safely in whatever way you want, but if you absolutely need to use memcpy at address 0 you can write your own version of it and use it instead of the default one. Regards, Luca (Cosmic) |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
1474 浏览 1 评论
2142 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1511 浏览 1 评论
2836 浏览 6 评论
5271 浏览 21 评论
365浏览 4评论
557浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
283浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
635浏览 3评论
533浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-27 13:08 , Processed in 0.828020 second(s), Total 75, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号