[A86] Re: I have several questions.
[Prev][Next][Index][Thread]
[A86] Re: I have several questions.
On Fri, 4 Jan 2002, Dillon Foley wrote:
> First, I was wondering how shells like ishell, can tell stuff like the
> icon and shell title after they find a program.
Because it is in the data at the beginning of a program. The contents of
a program are just a sequence of bytes in memory like any other data, so
they can be read just by examining the start of the variable, in which
this data is encoded in a simple way.
> Also, would it be possible for programs to share routines by reading
> from compiled programs. Like for instance could you put a program on
> your calculater called draw, that would just be a findpixel, putsprite,
> and tilemap routine all wraped into one so that programs can access it.
> That way if you have 6 compatible games on your calc they would all use
> program draw instead of having the routine in each individual file.
>
> I'm asking these, because, although I'm not the most experianced
> programmer in the world, my goal is to create a shell, that can take
> advantege of shared routines (if possible) by having some built in to
> it, so that you dont need a whole bunch of small files on your calc.
The sharing of routines certainly is possible, and has been tried before.
However, in this case your program wouldn't read the routine, but just
call them, in which case the processor reads and executes them just like
any other code. Though they probably would have to be copied to an
appropriate location in memory first, as variables can be at just about
any location.
There are, however, both technical and politcal obstacles to implementing
any such sort of system.
One problem is that there is not one standard findpixel, putsprite, or
tilemap routine out there. Instead, there are many different ones with
minor and major differences.
If all of the routines will be in the shell, then implementing it is
probably not much harder than implementing a regular shell; you only need
to put the routines in some well-known place in temporary memory before
running the program. For external library files, it will be a little
harder as you have to search for variables and then copy them to the
designated place. This would especially be the case if a program would
use multiple libraries from different sources, as then you might not be
able to arrange one unique memory location for each library to be copied,
but instead would need to adjust the addresses used (which of course is
possible, but requires you to make relocateable code that commonly used
Z80 assemblers don't do by themselves).
On the political side, many people would be likely to object to having to
use additional files containing library routines and/or requiring a
specific shell for programs when neither was a past requirement.
References: