In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote: @Terry; I have my code running correctly, but I can't use SX/B to do it. The word subtraction you are using in your own divide routine yields the correct result, and is an elegant answer. Also I'm now having trouble with the carry-out from some number sets when using the word add SX/B instruction, and the similar approach as suggested by Peter Verkaik referenced in the above post will also fix that: mov w,__Param1 add __Param3,w mov w,__Param2 snc mov w,++__Param2 add __Param4,w 'carry out is correct here Is there a reason why the compiler could not be altered in the suggested manner to fix these? Seems pretty simple? @Peter; As I get older, I seem to forget more things.... heavens this was just discussed (but not fixed) only April of this year, and already I can't remember it !!! In your referenced addition example, what is the purpose of the movsz w,++Value verses just mov w,++Value ? I don't get the SZ part. 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=361053#m361099 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)