
FLAG SCAN - Version 1.0
=======================
Released On: 08/08/99
Created By Jason Kovacs
Email: Jason_K@calc.org
ICQ Number:  27144093
Visit www.calc.org/tcpa


What This Program Does
======================

This program sets up an Interrupt which draws a Status Bar to the
bottom of the screen, even when the user is not running a program
and in the OS. On that Status bar, the states of all the Bits in
a Byte are shown, if they are On or Off. This Byte that is being
scanned and displayed is determined by the user in the program
itself, and is an offset from the current IY value that was fixed
in Rom. The IY Index Register currently points to an Area in Ram
where all the System Flags on the Calc are. The IY offset can then
be changed, and a different System Flag on the 83 can be scanned.


The Purpose Of This Program
===========================

This program is meant for Educational Purposes, for learning how
to do Interrupts on the TI-83, as well as other programming tech-
niques that it covers. The source is included and fully commented,
so that anyone can read it, and follow it line by line. I hope
someone learns something from the source, in any way possible. :)

Also, the way the program functions, it lets you veiw the state of
any System Flag on the TI-83, and this can be useful when browsing
through the OS, and see what gets changed on the Status Bar. Any
results achieved from that can then help ASM programmers adapt to
the OS more, and create better programs. I hope that many people
will use this Interrupt Program, and help discover any undocumented
System Flags, and their purposes on the calc. 


Included In The Zip File
========================

FLAGSCAN.83p - The Basic Program To Execute Which Sets Up The ASM Prog.
FLAGSCAN.txt - This Text File You Are Reading At This Very Moment. =)
ZFLGSCAN.83p - The ASM Compiled ASM Program Which Does Everything.
ZFLGSCAN.z80 - The Source To The ASM Program, Fully Commented BTW... ;)
ZASMLOAD.83p - The Loader Made By TI, Which Executes The ASM Program.
SYSFLAGS.txt - The Text File That Has All The TI-83 System Flag Info.
JASON.INC    - The Include File that I Use For ASM Programming.

How To Use This Program
=======================

Put FLAGSCAN.83p, ZFLGSCAN.83p, and ZASMLOAD.83p, onto your Calc.
Run the program FLAGSCAN from the Programs Menu. *See The Note*

Press MODE to Toggle between Enabled and Disabled Interrupt Modes.
Press the UP and DOWN keys to change the Current IY Offset that
 you want to have Scanned and Displayed when the Interrupt is On.
Press the CLEAR key to Exit the Interrupt Program back to the OS.

Just Browse around the OS now, doing any normal functions, and see
 how the State of that IY Offset changes as you do different things.
Make Observations and Experiments with the Bits of the System Flag
 Bytes, and write down Any Interesting Changes you see in the Bits.

Mail Me at "Jason_K@calc.org" with anything you find, that has not
 already been Documented in the System Flags Text File. I will then
 make observations myself, and update this file for the TI-83 ASM
 Community to use. Credit will be given and put in this text file
 to anyone who accurately discovers some Undocumented System Flags.

Note: I suggest that you Do Not make the Basic program Compatible
 with Shells, because most shells set the Interrupt Mode to IM 1
 and when you exit the ASM program back to the shell, that will
 defeat the purpose of loading the Interrupt and Enabling IM 2.
 Running this program though a Shell prolly wont mess anything up,
 it will just not activate the Interrupt at all, and you will see
 no Status Bar on the Bottom of the Screen during the OS.


The System Flags Text File
==========================

This Text File contains Information about all the known System Flags
on the TI-83. Some were Documented by Texas Instruments, but many
were not, as is why this program can be useful in finding out such
information. All Known Undocumented System Flags will be located in
this text file also. Not all Flags are as useful to Programmers as
others, and some Bits on each IY Offest arent even used, but all that
is known will be in this Text File. The Functions of each useful Bit,
depending if they are Set or Reset, will be explained in this File.

Information in this Text File may not always be the most recent info,
and since this program cant be re-released every time something new
is discovered, updates on it can be found at the TCPA Webpage. The
URL is "http://tcpa.calc.org/". Updates of the Whole Program will be
re-released to other calc sites, if major improvements are made to the
program such as the Bug-Fixes, of the ones mentioned below. 


Credits & Thanks
================

I'd like to thank Ian Graf for his Interrupt Programs, and I must
admit there may be segments of code in this program which came from
his Capture83 program, but I had learned alot from his method, and
see that the code he uses is really the best, so why not use it in
my program to help other learn it also. I do thank him and James
Matthews for providing Information about Interrupts in AsmGuru...
I'd also like to thank Joe Wingbermuehle, Dan Englender, and Scott
Dial for various things, I can't remember exactly what now, but they
have helped me a whole lot on all that I know about ASM now. Shane
Popham has also helped me by trying out this program, and giving me
positive and encouraging feedback on it, so I'd like to thank him 
for that. Also David Philips and Matthew Johnson for the Interrupt
Theory Discussion on IRC once, that helped me learn some stuff... :)

Thanks to the people at Texas Instruments for providing the TI-83 
ASM Community with all that they did in their Include File. It can
be found at "http://www.ti.com/calc/docs/83asm.htm".

Credits For Individual Discoveries of Information about the System
 Flags can be found in the System Flags Text File.


Known Bugs and Undesired Effects
================================

If the Interrupt is Enabled and the Calc's Self Test is Executed
with [Mode+Alpha+S], a "RAM FAIL" will result giving that message,
then the Calc will Freeze causing you to remove the batteries. If
the Calc's Memory is Reset by going to the MEM Menu, the Calc will
also Freeze. The reasons of the occurances are unknown, but they
do not occur in other Interrupt programs released. The best way to
avoid these Calc Freezes is to just Disable the Interrupt first,
before preforming such actions. If anyone can Determine why this
program causes the calculator to freeze at those points, that info
would be greatly appreciated, and would benefit the TI Community.
Credit to anyone for that Bug Fix will also be Documented here...

If the LCD is scrolled while the Interrupt is Enabled, the Bar at
the bottom of the screen will Scroll up 7 Pixels as well. The Times
the screen may scroll are when writing to the 8th Line of the home
screen, or when moving through the Catalog, but any other menu
will not cause the scrolling to happen. The screen can be fixed
by just clearing the screen, but actions were not taken to prevent
the screen from scrolling, because such changes would affect the
system flags which defeats the purpose of having this program run.

The Drawing of the Status Bar on the bottom of the screen may be
delayed and it looks like it may blink because it is not drawn on
every interrupt. That was incorporated so that the procedures of
the Normal OS wouldnt be slowed down too much. With the Installed
Interrupt only occuring infrequently, the key response is much
better, but the Cursor still looks like it has slowed down, but
the OS will preform normally otherwise.

If Menu Choices Occur in the Bottom Line of the Homescreen, they
will not be able to be seen, because they are covered up by the 
Status Bar, but Stuff can still be selected from there, and the
Cursor on the MODE Screen will still function correctly for the
Settings of "Full", "Horiz", and "G-T" Screen Modes.


Possible Unknown Bugs
=====================

If this Interrupt is Installed and Enabled while another Interrupt
is Running, problems may occur which may result in the calc being
shut down or freezing, but this hasnt been tested yet. To avoid
the chances of such things happening, please Disable all other 
interrupts before Enabling this One.


Disclaimer
==========

Please keep in mind that ASM programs put the Calculator in an
Unstable State, and Running our own Interrupt Behind the OS's
Normal Interrupt makes it even less stable, but so far only the
bugs mentioned have been noticed. Remeber to always back up your
calculator before running any ASM program on it, because anything
could happen. Although, the TCPA and any of its members take no
responsibilty for the crash of your calculator by the use and
misuse of this program.


Distribution
============

These programs may be distributed on other TI Calculator Sites,
as long as the Files are not altered and redistributed. The System
Flags Text file may archived seperatley in say, an Informational
Directory of the Website, as long as that file is kept up to date
when this Zip File is Re-Released. It is optional to update the
file when minor changes are made to its contents by the TCPA.

______________________________________________________________
Copyright (c) 1999 - TI-Calculator Programming Alliance [TCPA]

