Examples of MSP430(G2553) assembly
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.4 KiB

msp430 assembly examples

A record of my journey learning MSP430 assembly. A series of examples that aim to arrive at assembly code for a RFM69-radio based sensor network: some code for the sensors themselves, some code for a gateway.

My starting point was mecrisp forth - which is also an excellent basis for working with MSP430! Highly recommended! (But I wanted to learn some assembly.)

Since mecrisp sources are written for/compiled with macro assembler, naturally these examples are for that as well.

All code is for MSP430G2553, presumably sitting on a MSP430G2 Launchpad. You'll want the excellent mspdebug for programming the chip and debugging.

register conventions

See common/regconvention.asm. I renamed the registers and am pretty much using only the aliases, according to the "convention" specified in that file.

function calling conventions

I am mixing two approaches: I try to make function parameters to be passed in registers (a0,a1,...) to try to avoid memory read/writes. However some functions do use the data stack that's set up in core.asm. You need to look at the comments around the function definitions to find out which one is being used. (Starts at 04-.)


  • rfm69 tx
  • rfm69 rx
  • readline?
  • gateway