Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Jerros on July 12, 2010, 05:45:30 am

Title: Exiting an APP: bjump _JforceCmdNoChaR isn't working!?
Post by: Jerros on July 12, 2010, 05:45:30 am
I've figured that exiting an APP by simply using "ret" causes ram resets, so after some searching I fount that the prober way to exit an APP is by using the instruction :
Code: [Select]
bjump _JforceCmdNoChaR
However, when I try to compile it, my assembler (AppDev) gives the following error message:

"Macro expects args but none found"

What's the deal with this? Am I using the wrong command? or what arguments am I supposed to use?
If any more information is needed, just ask.
Hope someone can help me out here!
Title: Re: Exiting an APP: bjump _JforceCmdNoChaR isn't working!?
Post by: BuckeyeDude on July 12, 2010, 05:56:10 am
your include file (ti83plus.inc) likely defines bjump as a macro rather than an instruction, meaning that it wants parenthesis around it:
Code: [Select]
bjump(_JForceCmdNoChar)I believe the include file defines the instruction as B_JUMP, but i'm not positive, as I perfer the bjump() style syntax
also you can save 2 bytes in your code by using bcall instead of bjump. It will do exactly the same thing, and doesnt matter its suppose to be a jump, since this call will never return anyway
Title: Re: Exiting an APP: bjump _JforceCmdNoChaR isn't working!?
Post by: Jerros on July 12, 2010, 06:22:47 am
Thanks, using "b_call _JforceCmdNoChaR" fixed it, though I could SWEAR I've tried that already, else I wouldn't post it here...
Anyway, seems to work allright now, thanks alot!
Title: Re: Exiting an APP: bjump _JforceCmdNoChaR isn't working!?
Post by: Quigibo on July 12, 2010, 07:00:21 am
Buckeye, is that trick to use bcall() instead of bjump() always safe to use?  And does that also work with bjump(_Mon)?
Title: Re: Exiting an APP: bjump _JforceCmdNoChaR isn't working!?
Post by: BuckeyeDude on July 12, 2010, 07:50:02 am
No, only in the case of _JForceCmdNoChar will this work. The only reason it works is because the routine itself resets sp to the level the os expects it to (along with cleaning everything else up). Otherwise its the equivalent of trying to replace a jp Label with a call Label
I think bcall(_Mon) should work, test it. I've never really had to use the system monitor
Title: Re: Exiting an APP: bjump _JforceCmdNoChaR isn't working!?
Post by: thepenguin77 on July 12, 2010, 10:14:56 am
bcall(_Mon) works. I didn't even realize it was supposed to be a bjump.
Title: Re: Exiting an APP: bjump _JforceCmdNoChaR isn't working!?
Post by: DJ Omnimaga on July 12, 2010, 12:35:25 pm
Glad it got fixed ^^

Also welcome back :)