I'm new to assembly language programming of the MSP430 (not assembly in general, but new to the 430 in this mode.)

I'm trying to create an instruction to write a byte of data to RAM, where the address is in a register.

This is an example:

mov.b  #123, R8    ; this would be a value
mov.b  #0x251, R9 ; this would be an address in RAM

Now the idea is I want to put the 123 in R8 into a byte at 0x0251 which is pointed to by R9.

I try this:

mov.b  R8, @R9

but it will not assemble.

As I look through the Chris Nagy book (embedded systems design using the TI MSP430 series) I cannot find any usage of this sort of instruction; all of the examples I can see either read from RAM this way (mov @R9, R8) or write to an absolute location (mov R8, &somewhere-absolute), but these do not solve my problem.

I had previously been working in C and had no difficulty writing to RAM using a simple assignment operator and pointer arrangement.

What am I doing wrong?

Very tks,

Dave
[email protected]



Reply via email to