In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: On my ISR-based SX projects, I generally use a NOPRESERVE for the ISR and assembly. However, I have one project where I want to use the param registers in both the ISR and the mainline program. In looking over generated source code in SX/B, I noticed a few things that I need clarification on: - it appears that only PARAM1 - PARAM4 are preserved in the INTPARAMFSR registers; PARAM5 (aka __PARAMCNT) does NOT appear to be preserved. Since it seems to be common practice in SX/B to use __PARAMCNT, it would seem that if an interrupt occurs during the first few lines of something like the following, then you could be trouble. Or am I missing something? I generally use ASM and do not use the param registers in my ISRs, but still... [code] SomeSub: IF __PARAMCNT = 1 THEN tmpW1 = __PARAM1 ' if interrupt occurs here, and paramcnt is used by SX/B operations in the ISR, then it could get mucked up ELSEIF __PARAMCNT = 2 THEN tmpW1 = __PARAMW12 ENDIF [/code] - since PARAMS are "preserved" in the __INTPARAMFSR registers during an interrupt, IF I AM DECLARING NOPRESERVE, it looks like I could claim back these registers for my own purposes? It appears (in my generated .src output anyway) that __INTPARAMFSR is declared and the var space is assigned whether or not is used? ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=269659 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)