MC9S08PA4 warning

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MC9S08PA4 warning

跳至解决方案
705 次查看
mikee_
Contributor I

Hello,

 

I am getting this strange warning every time I compile my code.

 

In my code I start by Initialization section when I configure the PORT registers as follows.

 

BCLR    0,PORT_PTAOE  

; Output disabled

 

BSET    0,PORT_PTAIE   ; Input Enabled

 

I am using Freescale Codewarrioe 10.6 and the compilor does not seem to like something about my code. I get the following warning for each line in my code where I try to configure a register.

 

The warning is the following: A13003 Value is truncated to one byte.

 

Any help?

 

Many thanks

 

M.

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
609 次查看
tonyp
Senior Contributor II

Check the values for the PORT_PTAOE and PORT_PTAIE symbols.

If they are not in zero page (i.e., have an MSB of zero) then you cannot use the BSET/BCLR instructions.  You will have to use a LDA/ORA/STA (BSET) or LDA/AND/STA (BCLR, using inverted mask) sequence instead.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
610 次查看
tonyp
Senior Contributor II

Check the values for the PORT_PTAOE and PORT_PTAIE symbols.

If they are not in zero page (i.e., have an MSB of zero) then you cannot use the BSET/BCLR instructions.  You will have to use a LDA/ORA/STA (BSET) or LDA/AND/STA (BCLR, using inverted mask) sequence instead.

0 项奖励
回复
609 次查看
mikee_
Contributor I

Thank you so much.

you were right !!

0 项奖励
回复