In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote: Hi Peter; On confirming this, you are absolutely correct in the case of adding two words together. Subtracting two words is done correctly. Adding or subtracting a byte to a word are also both done correctly. In the case of adding two words, Bean simply has the order backwards, the '_lsb needs to be added before adding the '_msb. Here is the compiled results on adding/subtracting two words as well as a word with a byte: [code] 342 0000 0215 ADD WordOne_MSB,WordTwo_MSB ;WordOne = WordOne + WordTwo 0001 01F5 343 0002 0214 ADD WordOne_LSB,WordTwo_LSB 0003 01F4 344 0004 0603 ADDB WordOne_MSB,C 0005 02B5 345 346 0006 0214 SUB WordOne_LSB,WordTwo_LSB ;WordOne = WordOne - WordTwo 0007 00B4 347 0008 0703 SUBB WordOne_MSB,/C 0009 00F5 348 000A 0215 SUB WordOne_MSB,WordTwo_MSB 000B 00B5 349 350 000C 021C ADD WordOne_LSB,ByteOne ;WordOne = WordOne + ByteOne 000D 01F4 351 000E 0603 ADDB WordOne_MSB,C 000F 02B5 352 353 0010 021C SUB WordOne_LSB,ByteOne ;WordOne = WordOne - ByteOne 0011 00B4 354 0012 0703 SUBB WordOne_MSB,/C 0013 00F5 Regarding the IFDEF, I have not had the time recently to mess with that, but I hope to look into it soon. Thanks for your interest. Cheers, Peter (pjv) ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=340221#m340527 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)