Re:A83: Running a program on startup
[Prev][Next][Index][Thread]
Re:A83: Running a program on startup
This is what I do know. If you have an interrupt (mode 2) running in the
background of the TI-OS, the only way to make it keep running after a
powerdown is to create a powerdown yourself. The way to do this would be
to first check if 2nd has been pressed (its under shiftFlags, I think) then
if it has been, check if ON has been pressed. (note: you can't check if ON
has been pressed by checking it's flag, because this is set by mode 1. You
have to use the interrupt port which I *think* is port 4, correct me if I'm
wrong) If ON has been pressed, then you powerdown the calculator. When
you turn the calculator back on, the calc will continue to run the
interrupt which should then reset the 2nd flag and reset the on flag. This
will prevent the TI-OS from powering down and reseting the mode to mode 1.
For the APD to work, you must manually decrement the APD counter and when
it reaches 0 you power down. Same as above, basically. After powering
down you must set the APD back to max.
btw... no, the interrupt code isn't destroyed when you power down thru the
TI-OS. It is just set back to mode 1.
About the archiving thing... no, there isn't and it's probably a good idea
because usually people have much more data in the archive than can be
contained in RAM. i.e. I have about 30k of archived progs. If i were to
use this theoretical rom call, I would get an error because I don't have
30k of RAM. I suppose you could make one yourself... just make sure that
you have enough memory to unarchive the program first, or maybe install an
error handler (btw, how DO you install an error handler??). Just go
throught PROGPTR and unarchive every program.
Oh and the reason why your string program isn't working is probably because
you didn't account for the relocation of the string. Example: when you
compile the code, it's base is at $9d95 so the string label would be say
$9e95. But when you copy the interrupt data (including the string) the
string is relocated to a memory area based on $9a9a. Get it? so instead
of displaying the string that is at $9b9a, your program is displaying some
gibberish located at $9e95. Another reason is because you're not supposed
to use rom calls from within an interrupt... something about switching rom
pages in an interrupt is bad. Or something.
Btw... the interrupt tutorial, was it the one I wrote?
----------------------------------------------
Original Message
From: "Robby Proie"<playnogamz@nls.net>
Subject: A83: Running a program on startup
Date: Thu, 15 Feb 2001 17:31:33 -0500
>
>Hi, I have another quetion mainly about interrupts.
>
>First of all, I know that when you turn off your calc and turn it back on
>again (Some where in that process), the interrupt mode is set back to one
>again.
>
>Questions:
>
>1. Is the code for your interrupt destroyed during the process of turning
>the calc off and on, or does tios not mess with it?
> -My code starts at 9a9a, if that is any help
>
>2. If it is not destroyed, is there any way to have the calc instantly set
>the interrupt mode to 2 when the calc is turned on.
>
>3. If it is destroyed, or there is no way to set the calc to mode 2 when it
>is turned on, how do I have the calculator automaticly run my program that
>installs the interrup at startup, aside from download the flash program
from
>ti the does that.
>
>4. This one doesn't really relate to the other questions, but is there any
>command in basic or asm that unarchives every program that is currently
>arcieved. If not, you don't need to make one for me, I can handle that, I
>was just looking for a shortcut.
>
>
>
_____________________________________________
Free email with personality! Over 200 domains!
http://www.MyOwnEmail.com