In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: I'm working on a program that is SX/B in the main program and almost all ASM in the ISR. The (minor) problem I was having on reset is that the ISR would start rolling before my own SX/B code at the start of the program had initialized things for me properly. For a quick workaround, my Start: SX/B code initializes a ready flag, an the ISR skips to it's own end until that bit is set. Since SX/B is so phenomenally convenient, I hadn't peeked at the generated startup code too closely until last night. So here's the conundrum -- it seems that either I need to do my work around, or not use SX/B because even with NOSTARTUP my ports and RTCC and such get set by the SX/B generated code *before* my user entered code appears in the list file. Or, I guess come up with more elegant code that start off in zero state better? Is that right? Quasi-related -- I've been playing with RAM banks and getting feel for working with indirect reading of registers. If the lower half of each ram bank is *always* the "global" vars ($0-$F), then in an SX/B program I am limited in my "true" global vars because of lot of the global ram bank is used by the param vars and such. 4 free global bytes by my count. I realize the upper half of bank 0 is quasi-global in SX/B because SX/B seems to always presume a "return" to bank 0, but again, since I don't really want to sacrifice the loveliness of SX/B I want to know what my constrictions are. Last newbie question -- in the SX/B startup code there are "mirror" registers for the ports that get setup? Like TRIS_A maps to $FA (if I remember correctly). $FA -- where is that? Are those special registers in the SX or what? ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=226665 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)