In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: Shawn -- SamTheMan's code is good, his description is a bit unclear -- what he is describing is putting any ISR code (with a regular JMP/GOTO) AFTER the sub declarations. I usually put the ISR code in the LAST code page of the app, not before "start", but that's secondary to having it after the subs. The reason is that every SUB/FUNC declaration must be in page 0 (the code for the sub/func itself can be anywhere). The start of the ISR (the actual INTERRUPT statement in SX/B or just plain ol' address $000 in ASM) is also in page 0. So as your ISR and/or your list of sub/func declarations gets longer, things can get tight very quickly. In my own apps, rarely would all the sub declarations and even a short ISR routine fit on page 0. So the answer is put your ISR code wherever you want (it's not a sub, btw, but an ISR) and GOTO following the INTERRUPT statement: [code] INTERRUPT 1000 GOTO Interrupt_Code ' takes only two instructions SUB x,y,z ' can have many many many sub/func declarations SUB x,y,z FUNC x,y,z ' etc Start: ' init code Main: ' main loop ' --- Subroutines SUB x ENDSUB ' --- ISR Interrupt_Code: ' more code here RETURNINT [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=357773#m357898 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)