From kris at abbey.co.nz Thu May 7 17:53:48 2009 From: kris at abbey.co.nz (Kris Heidenstrom) Date: Thu May 7 19:02:10 2009 Subject: [Icc-430] reading status register? In-Reply-To: <49F56B25.3080502@sensair.com> References: <30316713.2342381239916249096.JavaMail.servlet@kundenserver> <49F56B25.3080502@sensair.com> Message-ID: <4A03829C.5040406@abbey.co.nz> Peter Lissenburg wrote: > Hi All, > sorry, but I have a probably silly question. > I need to check the state of the status register. > Doing... > unsigned char SR; > asm("mov %SR, R2"); > ICC430 doesn't work, any suggestions? If you're trying to _read_ SR then you should say "mov R2,%SR" because the MSP430 instruction syntax is "source,destination" and you want to move from R2 (the actual status register) to the variable you've named "SR". Perhaps if you called your variable something else like SR_val this mistake would be easier to pick up. Regards Kris -- Kris Heidenstrom Embedded systems designer / programmer kris@abbey.co.nz Abbey Systems Ltd - Telemetry Specialists Wellington NEW ZEALAND Voice +64-4-385-6611 Fax +64-4-385-6848