next up previous contents
Next: st Up: Register and Memory Instructions Previous: ld   Contents

sts

The sts instruction is like a counterpart of lds. It stores the value of a register into a location in memory.

The first operand specifies the location in memory to store the second operand. It can be any number from 0x0000 to 0xffff. However, the MCU may not have the entire range of memory available.

The second oeprand specifies which register to store. You can use any one of the 32 register.

The following instruction stores the value of register 23 to location 0x007e in memory.

  sts  0x007e,r23



Tak Auyeung 2003-11-10