How can I store the value of a register directly to a memory address without the help of another register?

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

How can I store the value of a register directly to a memory address without the help of another register?

跳至解决方案
1,323 次查看
maojiu
Contributor I

How can I store the value of a register directly to an address without the help of another register  like "stw r1, 0x0000feee"? The statement  "stw r1, 0x0000feee" can't pass the compiling. I am using mpc8306.

0 项奖励
1 解答
1,153 次查看
scottwood
NXP Employee
NXP Employee

You can't, except for addresses that are within a signed 16-bit offset from zero (in which case you'd use r0 which is interpreted as zero rather than a register when forming an address).

在原帖中查看解决方案

0 项奖励
2 回复数
1,153 次查看
lunminliang
NXP Employee
NXP Employee

See Section 4.1.3 Memory Addressing and 4.2.3.1 Integer Load and Store Address Generation of MPCGFPE32B.pdfhttp://cache.freescale.com/files/product/doc/MPCFPE32B.pdf

Load and store operations have three categories of effective address generation that depend on the

operands specified:

• Register indirect with immediate index mode

• Register indirect with index mode

• Register indirect mode

1,154 次查看
scottwood
NXP Employee
NXP Employee

You can't, except for addresses that are within a signed 16-bit offset from zero (in which case you'd use r0 which is interpreted as zero rather than a register when forming an address).

0 项奖励