|
Part 2ýAll of the Details
by Walter Krawec
Introduction
ý Format() ý Install()
ý Directory() ý Run()
ý Menu() ý Saving
Memory ý Interfacing to the File Manager
ý Two Sample Programs ý Conclusion
ý Sources and PDF
MENU()
When you press "m," the Menu()
procedure prints what you see in Listing 1 to the SCI.
|
--MENU--
r : Run Program Menu -------------------+-->
p : Pause
m : Main Menu ------------------+
|--> x : Stop
|-----> r : Reset
|-----> s : Show Settings
|
| Listing 1ýHere
you can see the procedure waiting for a command. |
As you can see, the procedure waits for
another command, either "r" or "m." Then the file
manager waits again for another command (either "p" or "x"
following "r," or "r" or "s" following
"m").
If you request a pause, the procedure
stays in a loop. The loop exits only when another character is received.
Note that this loop executes even when a program isnýt running, but
you can fix this with a simple if() statement.
If you request a halt, the procedure
sets prg_run to false, changes address prg_addr-3 to false, and jumps
back to the main() procedure, which clears the stack and resets RTI.
Because prg_run is now false, no program will be run.
Resetting the file manager is accomplished
by simply jumping back to the beginning of the main() procedure.
Lastly, Show Settings prints out the
value of prg_addr.
PREVIOUSý
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |