Modify the value of variable in assembly

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

Modify the value of variable in assembly

1,314 Views
girichavana
Contributor II

Hello Support,

 

I am working on HCS08, with CW 10.1 assembly language programming.

 

I need support to write a assembly routine to modify the value of 32 bit variable.

 

Please support in this.

 

Regards

Giri

Labels (1)
0 Kudos
Reply
2 Replies

1,158 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Giri,

I believe this is the same issue as service request 1-1314984694

CW for 8bit mcu assembly instruction doesn’t have a simple instruction that can modify the value of a 32bit variable. This is limited by the related register width.

See below code: it is to set 32bit variable temp_long as 0xaabbccdd

temp_long ds 4

… …

       ldhx  #$aabb

       sthx  temp_long

       ldhx  #$ccdd

       sthx temp_long+2

Hope this helps!

-----------------------------------------------------------------------------------------

this answer is for you. if you think it helps, please click on the "correct answer" button, thanks!

Best Regards,

JunZhang

0 Kudos
Reply

1,158 Views
Wlodek_D_
Senior Contributor II

Hello,

Thank you for your post, however please consider moving it to the right community place (e.g. CodeWarrior Development Tools or 8-bit Microcontrollers) to get it visible for active members.

For details please see general advice Where to post a Discussion?

Thank you for using Freescale Community.

0 Kudos
Reply