In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Tony Leyland wrote: Thanks for the help Bean/John, I like the example you gave me John, so much so that it made me understand how to write SX/B apps with ASM subroutines that can access the SX/B vars. I've included a demo here of what I've put together so far (being a relative newbie, I've learnt a lot from this). When you step through it you can see (in SXSim) the registers change. The file 'SX-B Variables Example.SXB' is the main source to try, the other one being a 'Declarations' file. My vars are of 3 types:- Global, Normal, Extended. 1) Global variables. These are available whatever bank we are currently in and so are very special. 2) Normal variables. These are assigned within Bank Zero only. These are the most common ones used, but only 15 bytes or so. 3) Extended variables. These are 1 -> 16 byte arrays, assigned within Banks 1 -> 6 (SX/B uses Bank 7). Only use these when the 'Normal' ones have been used up (they need extra code overhead to access them). Single byte Arrays can be used to store Vars in other Banks. However, they do not work in FOR / NEXT loops apparantly. Thanks again, Tony ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=96744#m97873 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)