Re: A86: Program List


[Prev][Next][Index][Thread]

Re: A86: Program List




The way I do it, which is by no means fast, but it is rather small:

Let <$12,$08,"AAAAAAAA"> be the start value of your search.  $12
indicates that it is a program, $08 tells the calc how long the name is,
and 8 'A's is the lowest (alphabetically) name possible.

Feed this into a loop that calls _findAlphUp.  I think the zero flag
must be set if you want it to search by type, which you do. 
_findAlphaUp sets or clears a flag to tell you whether it found anything
or not (check the AsmStudio help file for this), and if it did, it
returns the variable name in OP1.  Store this to a list of name
entries.  Each entry can be a nice even 10 bytes long, since that is the
max length of a name.  Make sure to increment a counter so you know how
many entries you have in your list.  Loop until _findAlphaUp tells you
there are no more vars, then exit.  You now should have an entry for
every program on the calc, and a counter value to tell you how many
entries you have.  Then you can get individual names from your list by
multiplying a number (less than or equal to the total number of entries)
by ten (the length of each entry) and adding that number to the base
address of the list.

At least that's how I do it.

Cassady Roop

> Bryan Kam wrote:
> 
> Hey people,
> 
>     Another question for you: what is the most efficient way to get a
> list of the programs in RAM?  I'm trying to make myself a little shell
> and have been having trouble.
> 
> Bryan


References: