[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disk ][ Launcher (was: Late night musings...)
In article <50b1ll$bh6@news.bconnex.net>,
Jeff Blakeney <jefbla@bconnex.net> wrote:
>dempson@actrix.gen.nz (David Empson) wrote:
>I hadn't thought of that. Mind you I'm still in the design phase.
"No batle plan survives contact with the enemy." (Apparently, Sun
Tzu, the Art of War). Programming isn't that bad, but until you're
real good (especially with quirks like emulation), expect a lot of
surprises when your code runs against real world stuff.
>>It would still boil down to checking each executed instruction to work
>>out what was being accessed, then executing that instruction. It would
>>probably be easiest to emulate the CPU, rather than trying to execute
>>the real instruction in place.
>I have been trying to come up with ways to allow execution of the 8
>bit programs to be performed by the 65816 at full speed. By caching
>small sections of code and checking them for anything special and then
>executing any code I'm not concerned about at full speed or by putting
>COP instructions in those special locations but I can't really think
>of a way to find the places to put the COPs easily.
Doubtful this can be done easily or well. The main problem is that
the 6502/65C02 has variable instruction lengths, and no easy way to
determine if an arbitrary section of bytes is code, data, a mix, or
what. Your next problem is that if something is to run under GS/OS, it
must have a real light footprint on bank 0. That means pretty much
anything that hits I/O or video can't be run at full speed without some
major hackery. (Setting the B register to 00/01/e0/e1 could let you
do that, but would prevent any other writes to your program space if
your program is not in those banks).
If you can come up with a way of determining _well_ (90% solutions
are easy, and won't work with everything) which code hits video and
which doesn't, so much the better. About the only 'reliable' way to do
so is to manually emulate all code in a given range (say one page),
and verify that it has no writes to video or i/o. Then, until
something writes to that page or dp locations used by that page, you
can run it at full speed. Now when there are lots of pages with
interlocking dependencies, this gets real ugly real fast.
You may be satisfied with something that runs a program or
two. Those of us who do programming for a living have learned to hate
90% solutions-- they're guaranteed to stand up and bite you later.
Doing it right the first time will save you a LOT of trouble later on.
Nathan Mates
--
<*> Nathan Mates http://www.visi.com/~nathan/ <*>
# What are the facts? Again and again and again-- what are the _facts_?
# Shun wishful thinking, avoid opinion, care not what the neighbors
# think-- what are the facts, and to how many decimal places? -R.A. Heinlein