Modify the value of variable in assembly

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

Modify the value of variable in assembly

1,312 次查看
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

标签 (1)
0 项奖励
回复
2 回复数

1,156 次查看
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 项奖励
回复

1,156 次查看
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 项奖励
回复