[A83] Re: Calculator power-off woes
[Prev][Next][Index][Thread]
[A83] Re: Calculator power-off woes
Are we talking about the ti-83 or ti-83+ ? I'm pretty sure the ti-83
doesn't switch back over to im 1 at the time of APD. If you are working on
the ti-83+ then you can use your im 2 interrupt to check if the calc is
APDing (see below) then you can push a return location onto the stack(your
im 2 reinstaller). When booting back up, the calc encounters a "ret"
instruction which normally would return to the program being run but since
you pushed the reinstaller, it returns to your interrupt reinstaller where
you can reload your data into savescreen as well.
;This particular routine should not be placed in savesscreen
interruptReinstallSubroutine:
di
ex af,af'
exx ;remember when this subroutine is called its returning from an
interrupt and we can't modify the registers or else the interrupted code
will freak
;** what ever you gotta do to install the interrupt**
ex af,af'
exx
im 2
ei
ret
myInterrupt:
di
ex af,af'
exx
ld hl,(apdsubtimer)
dec h
dec l
ld a,l
or h
jr nz,myInterruptCode
;if z then the calc is about to apd so push interrupt reinstaller location
onto stack
ld hl,interruptReinstallSubroutine
push hl
myInterruptCode:
;**your code goes here**
;end of interrupt
exx
ex af,af'
jp 0038h
----- Original Message -----
From: "Jeff Theusch" <telepath75@hotmail.com>
To: <assembly-83@lists.ticalc.org>
Sent: Tuesday, August 05, 2003 4:35 PM
Subject: [A83] Re: Calculator power-off woes
> Problems: My interrupt resides in savesscreen, plus the TI-OS APD changes
> the IM to 1. The end of my main interrupt routine does include a JP $003A
> (I didn't exx\ex af,af' again) but for purposes of turning the LCD on
after
> the halt, I thought it would be best not to. Maybe I will try something
> else... maybe im 1 before the halt, then im 2 after?
>
> >I'd suggest letting the os do the work for you. I think this code may
work
> >for you:
> >
> >myInterrupt:
> > di
> > ex af,af'
> > exx
> >
> > ;**your code goes here**
> >
> >;end of interrupt
> > exx
> > ex af,af'
> > jp 0038h
> >
> >
> >This supports APDing and if you want to immediately turn off the
> >calculator,
> >you could simply adjust the APD timer to 1.
> >
> >brandon sterner
> >
> >----- Original Message -----
> >From: "Jeff" <telepath75@hotmail.com>
> >To: <assembly-83@lists.ticalc.org>
> >Sent: Tuesday, August 05, 2003 2:39 PM
> >Subject: [A83] Calculator power-off woes
> >
> >
> > > HELLLLLLPPPP! I think I've tried everything!
> > >
> > > I am working on a custom interrupt mode 2 routine for the TI-83, and I
> >want
> > > to turn off the calculator within it. The problems I have are:
> > > (1) out (3),1 does not turn off the LCD
> > > (2) halt either responds to no interrupts (frozen calc, turnon is
never
> > > called, usually happens on both VTI and real calc) or responds to all
> > > interrupts, including timer (happens when I step thru in VTI).
> > >
> > > This is basically the code I want to use:
> > >
> > > int_start:
> > > exx
> > > ex af,af'
> > > bit pwrflag
> > > jr z,turnon
> > >
> > > .
> > > .
> > > .
> > >
> > > turnoff:
> > > res pwrflag
> > > ex af,af'
> > > exx
> > > push af
> > > ld a,01h
> > > ei
> > > out (03h),a
> > > halt ;wait for on-key interrupt (shouldn't this call
> >turnon?)
> > > di
> > > pop af
> > > exx
> > > ex af,af'
> > >
> > > .
> > > .
> > > .
> > >
> > > turnon:
> > > set pwrflag
> > > ld a,0Fh
> > > out (3),a
> > > exx
> > > ex af,af'
> > > reti
> > >
> > >
> > >
> >
> >
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
>
References: