Immediate addressing HC12

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

Immediate addressing HC12

跳至解决方案
2,527 次查看
Pitrunner
Contributor I
Hello everybody,

I 've flw problem with CW. I want to load two ASCII signs in accu D. The code looks like LDD #'AA'. But I got an error message illegal addressing mode. If I load only one ASCII sign like LDD #'A', all is perfect. Has somebody an idea? Thank you for the help.
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,043 次查看
CompilerGuru
NXP Employee
NXP Employee
With a


LDD #('a' << 8) + 'a'


You should get the same code (should because I did not try it out).
I dont think multi byte character constants are supported in the CW HC12 assembler.

Daniel

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,043 次查看
pittbull
Contributor III
Hi,
Try this:

// Store 'AB' into D
LDAA #'A'
LDAB #'B'
0 项奖励
回复
1,043 次查看
Pitrunner
Contributor I
Thank you for the answer.
This solution I know.
LDAA#'A'
LDAB#'A'

But we have here an old HP assembler for our HC11 controller and with that assembler the
LDD #'AA' instruction works.
0 项奖励
回复
1,044 次查看
CompilerGuru
NXP Employee
NXP Employee
With a


LDD #('a' << 8) + 'a'


You should get the same code (should because I did not try it out).
I dont think multi byte character constants are supported in the CW HC12 assembler.

Daniel
0 项奖励
回复
1,043 次查看
Pitrunner
Contributor I
Daniel,

thank you for the hint that multi byte character aren't supported with CW.
So I will try your solution.
0 项奖励
回复