Immediate addressing HC12

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Immediate addressing HC12

Jump to solution
2,526 Views
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.
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,042 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
1,042 Views
pittbull
Contributor III
Hi,
Try this:

// Store 'AB' into D
LDAA #'A'
LDAB #'B'
0 Kudos
Reply
1,042 Views
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 Kudos
Reply
1,043 Views
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 Kudos
Reply
1,042 Views
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 Kudos
Reply