FreeRTOS+SMAC on 13192-SARD(CW5.1). Strange asm code.

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

FreeRTOS+SMAC on 13192-SARD(CW5.1). Strange asm code.

1,947件の閲覧回数
cheese
Contributor I
I`m trying to work with FreeRTOS + HCS08 + SMAC from here:
http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&message.id=508
with CW5.1.
In the ordinal SMAC C-code

if (MCPSDataRequest(&gsTxPacket) == SUCCESS)

is compiled to

JSR 0x1a57 ;jumping to MCPSDataRequest
CMP #0x77

And that is resonable, because MCPSDataRequest returns value via A register.
But in the mentioned project FreeRTOS + HCS08 + SMAC the same C-code compiled to

JSR 0x2A50 ;jumping to MCPSDataRequest
CPHX #0x0077

comparing the HX register value with SUCCESS. But the returned value is still in A register and this check fails.
So, how to get back the right behavior?
Thanks in advance.
ラベル(1)
0 件の賞賛
返信
2 返答(返信)

847件の閲覧回数
CompilerGuru
NXP Employee
NXP Employee
What is the return type of MCPSDataRequest?
There are different reasons why this could happen:
- for implicit parameter declaratios, the return value is an int by ANSI. Therefore dont use implicit parameter declarations if anything returns just 8 bits (well actually never ever use implicit parameter declarations).
- The returned type of MCPSDataRequest could be configured to be of a different size, for example enums can be configured to be 8 bit or 16 bit.

my feeling is that the code has some implicit parameter declarations. Does do create warnings by default and those warnings should be taken seriously.

Daniel
0 件の賞賛
返信

847件の閲覧回数
cheese
Contributor I
Yes, it was really implicit delaration.
Thanks a lot, the problem is solved
0 件の賞賛
返信