XGate assembler IMM16 addressing mode not supported?

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

XGate assembler IMM16 addressing mode not supported?

3,172 Views
Oliver
Contributor III
Hi,

I am writing an application using XGate assembly, and I am trying to use the immediate 16 bit addressing mode IMM16 as outlined e.g. in section 8.8.1.6 of the 9S12XDP512 manual:

LDW R6,#0

doesn't work in either assembler or inline: "Error A22005: Number or type of operands mismatch"

Is this unsupported or am I doing something wrong? (I am using CW4.5 for HC12 Build 6037)


Best regards,

Oliver
Labels (1)
0 Kudos
Reply
3 Replies

495 Views
CompilerGuru
NXP Employee
NXP Employee
Hmm. I'm not having a clean installation here, so I'm not sure if this was added to 4.6 already or if it came later (and has not been officially released therefore). Out of the release notes of the XGATE assembler

  - Fixed: the inline assembler did not handle pseudo-instructions with 16-bit immediates (e.g. LDW RD, #IMM16)

With your assembler, you can use the two single instruction LDW maps too directly (or even in a macro)
E.g.
 XREF ExternalLabel
 LDL        R6,#%XGATE_8(ExternalLabel)
 ORH        R6,#%XGATE_8_H(ExternalLabel)


Anyway, for me those pseudo-instructions are more traps than useful features.
I mean "LDW R6,#0" is an especially inefficient way to load 0 into R6, a "LDL R6,#0" is twice as efficient, and just using R0 instead of R6 is even better :smileyhappy:.
I like to see what is going on, and those pseudo-instructions just hide that.

Daniel

0 Kudos
Reply

496 Views
Oliver
Contributor III
Hi Daniel,

thanks for the response.

Actually, I'm loading a 16-bit constant into the register, I just wanted to keep the example simple.
I'm using the LDL/LDH immediate instead of LDW now, but LDW would make the source
a little more readable. What is the advantage of using ORH instead of instead of LDH?
As far as I see the only difference is that the CCR is affected.

I checked the updater and there was no update available. Is 4.6 available already, or do I have to order it?

Best regards,


Oliver
0 Kudos
Reply

496 Views
CompilerGuru
NXP Employee
NXP Employee
4.6 is available for download. It is not an update, it is a full release though.
And again, not sure about the status of this issue in there, I don't have it installed here.

My use of the ORH was not meant to say it's in any respect better than LDH. Use LDH
:smileyhappy:, just as fine.

In my point of view, I want to see in assembly what the code really does. In case I don't really care, I use C :smileyhappy:.

Daniel

0 Kudos
Reply