Hi there,
i am using Codewarrior IDE 5.9.0 build 5294 and i am trying to compare 2 tables with memcmp.
if both tables are in near memory then there is no problem. if one of them is in far memory then memcmp does not get the correct address.
it gets a 16bit address. I know that in standard c there is also _fmemcmp for far pointers. I am including ansib.lib that does not include _fmemcmp.
Should i include a different library or there is another workarround?
Thanks in advance.
Solved! Go to Solution.
Hi
I think it's easiest to take some known memcmp implementation, rename it, and just add missing far keywords.
c/c++ memcmp: c++ - Implementing memcmp - Stack Overflow
Thank you both.
I have created my own memcmp for far pointers as Edward proposed.
Hello
ANSI libraries delivered with CodeWarrior for HCS12 are configured to handle near pointers if you are building in banked memory model.
This post provides you with some hint son how you can get memcpy or memcmp to handle far pointer as well.
CrasyCat
Hi
I think it's easiest to take some known memcmp implementation, rename it, and just add missing far keywords.
c/c++ memcmp: c++ - Implementing memcmp - Stack Overflow