Immediate addressing HC12

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

Immediate addressing HC12

ソリューションへジャンプ
2,584件の閲覧回数
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,100件の閲覧回数
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,100件の閲覧回数
pittbull
Contributor III
Hi,
Try this:

// Store 'AB' into D
LDAA #'A'
LDAB #'B'
0 件の賞賛
返信
1,100件の閲覧回数
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,101件の閲覧回数
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,100件の閲覧回数
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 件の賞賛
返信