memcmp for far pointers

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

memcmp for far pointers

ソリューションへジャンプ
2,034件の閲覧回数
michaelsarafidi
Contributor II

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.

ラベル(1)
1 解決策
1,717件の閲覧回数
kef
Specialist I

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

元の投稿で解決策を見る

3 返答(返信)
1,717件の閲覧回数
michaelsarafidi
Contributor II


Thank you both.

I have created my own memcmp for far pointers as Edward proposed.

0 件の賞賛
返信
1,717件の閲覧回数
CrasyCat
Specialist III

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

1,718件の閲覧回数
kef
Specialist I

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