In SX Microcontrollers, SX/B Compiler and SX-Key Tool, johncouture wrote: Ref: IDE 3.2, SASM DLL 1.51.07, SXB 1.51 In the attached program, LCDSize is a a member of an array that is supposed to be equal to 80 once the calculation is done. My intent was to initialize that variable in the LCDInit subroutine, however for some reason it doesn't get set??? The gist of it seems to be in this statement (see line 475) LCDSize = LCDWidth * LCDLines When the FIRST parameter is a constant, LCDSize ends up being equal to zero??? ' set in the constants section LCDLines con 4 LCDWidth con 20 ' down in LCDInit subroutine x1 = LCDWidth ' x1 is a VAR, LCDWidth is a constant x2 = LCDLines ' x2 is a VAR, LCDLines is a constant LCDSize = LCDWidth * LCDLines ' yields a Zero '---------------- ' Test Results '---------------- This is the result of testing (without making any other changes in the program): LCDSize = LCDWidth * LCDLines ' yields a Zero LCDSize = LCDWidth * x2 ' yields a Zero LCDSize = LCDLines * x1 ' yields a Zero LCDSize = x1 * LCDLines ' Works, yields an 80 LCDSize = x2 * LCDWidth ' Works, yields an 80 LCDSize = x1 * x2 ' Works, yields an 80 A couple of times when I had two similar statements close together, I did get the following warnings: - Warning 48 Pass 2, File register not in current bank - Warning 37 Pass 2, Literal truncated to 8 bits ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=138128 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)