My question is : is it possible to do an affectation from ROM NEAR to RAM Far on HCS12?
( ram_far_var = rom_near_const ; )
Thank you for any help!!!
Do you intend to initialize a global variable located in paged RAm with a constant value stored in extended memory (between 0x00, and 0xFFFF)?
This is possible without any problem with CodeWarrior.
A normal C assignment with the proper variable definition and declaration should do it.
Thank you for your response CrasyCat.
Yes I want to affect a global variable located in paged RAM (@ 0xFC116C) with a constant value stored in 0x7E26.
I have a reset and I think its cause is this affectation.
In the code generated from this affectation I have the function _FAR_COPY_LOGICAL_NEAR_RC.
When reading the datapage.c I have:
HCS12X specific far copy routine. The name describes what the src/dest address format are.
All near srcarguments are passed in X, all 24 bit src in X/B.
All near destarguments are passed in Y, all 24 bit src in Y/A.
(Note: HC12 _FAR_COPY_RC is using X/A as src and Y/B as dest, so the register usage is not the same!)
Do you think that there is no problem with the compiler?if so what can be?
Thank you very much.
Waiting for your response.
I suspect there is something wrong in your project.
I would recommend you to submit a service request for that.
Click here to submit a service request.
Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.
Attach the generated .zip file to the SR.
I've an other question a copy from Near to far of 32 bytes,how much time can it take(S12XD)?
I hope to have a response even an approximative delay !
thank you very much.