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

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

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

Jump to solution
1,258 Views
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 Kudos
1 Solution
1,088 Views
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).

View solution in original post

0 Kudos
2 Replies
1,088 Views
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,089 Views
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 Kudos