On Flag? Huh?

A General Discussion forum for TI calculators

Moderator: MaxCoderz Staff

Post Reply
User avatar
L4E_WakaMol-King
Maxcoderz Staff
Posts: 342
Joined: Tue 01 Nov, 2005 6:34 am

On Flag? Huh?

Post by L4E_WakaMol-King »

I was reading around on the Learn ASM in 28 days thing, and found an On Flag (OnRunning). It it set to 1 if the calculator is on. Why in the world would you need that? It's not like you can write code to execute when the calc is off...
Image - Now Under Development - [Progress]
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

When you replace batteries, it might be nice to know what state the calc was in previously when the Z80 resets...
You know your hexadecimal output routine is broken when it displays the character 'G'.
Spencer
Extreme Poster
Posts: 346
Joined: Mon 17 Jan, 2005 8:56 am
Location: Indiana

Post by Spencer »

Well, the flag would be reset if the batteries are removed. It's likely for benefit of interrupt events that can occur when the calc is off. Link port, on key. Then again, I know nothing of TI-OS ...
User avatar
L4E_WakaMol-King
Maxcoderz Staff
Posts: 342
Joined: Tue 01 Nov, 2005 6:34 am

Post by L4E_WakaMol-King »

Hmm, perhaps. But even in these cases mentioned, it would have to be 0 at some times... and it doesn't seem to make much sense for the calc to check if it is on.

If it's being used for something like battery replacement or link port stuff, then it would have to remain as 0 even a little after being turned on. Then the calc could check if it is on and find that, in fact, it is off. Talk about an identity crisis...
Image - Now Under Development - [Progress]
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

The calculator is still running when it is off, it is just halted and waiting for an interrupt. So I guess if the on flag is not set, then power down and wait for this interrupt.
Image
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

isn't the calc still consuming power when it's off?
Image Image Image
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

Yes, but very little.
Image
User avatar
NanoWar
Extreme Poster
Posts: 365
Joined: Fri 17 Dec, 2004 6:39 pm
Location: #$&"%§!
Contact:

Post by NanoWar »

You can send a file while the calc is off. Wow, that's useful..
Revolution Software
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

The calculator switches itself on when you do anything on the link port (there are a number of different things that can fire interrupts - timers (disabled when the calc is off), on key, and link port).
I believe the on flag is just to save the state of the calculator - if it handles an on-key interrupt, it then checks the flag. If the calculator is off, it switches on. Otherwise, it checks for the 2nd key flag (and if that's set it switches off). Then it toggles the flag.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

benryves wrote:The calculator switches itself on when you do anything on the link port (there are a number of different things that can fire interrupts - timers (disabled when the calc is off), on key, and link port).
Unfortunately Ti-83s don't have the link interrupt, or so I've been told... I'll try never the less of course :)
I believe the on flag is just to save the state of the calculator - if it handles an on-key interrupt, it then checks the flag. If the calculator is off, it switches on. Otherwise, it checks for the 2nd key flag (and if that's set it switches off). Then it toggles the flag.
Sounds very likely
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

The link interrupt comes with silent linking, right?
Image
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

I thought the link interrupt was when you plugged in the link cable, and it turned on the calc.
You know your hexadecimal output routine is broken when it displays the character 'G'.
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

I don't know, I was asking.
Image
Kalimero
Regular Member
Posts: 130
Joined: Fri 17 Dec, 2004 1:47 pm

Post by Kalimero »

bit 4: link port interrupt line, 1 means interrupt requested
An interrupt is requested when both lines were high and one or both go low, either when this calc or the other end drives a line low or because while plugging in a cable, one of the lines is briefly connected to ground.
Post Reply