Re: A86: can one program be on two pages?


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

Re: A86: can one program be on two pages?




This is a little late (and i still have 110 mails left to read :-)
that's what i get for going on vaction!), but it is quite possible to
run a program over 30.9k.  If a program is that big in the first place,
then there are two things that should be true.  (a) The programmer
should realize that the program would be too big, and would make the
modifications himself, and (b) it should be written modularly.  Any asm
program over 10k or so could easily be broken up into a few different
programs, and since the TI-86 ROM supports modular programs, that
wouldn't even be a problem.  Granted, it _does_ cut into execution
speed, but if you really need the speed, you often will use your own
routines over TI's anyway, because the routines in the ROM are almost
never specific enough for your needs.  So, if you need speed, you could
make a separate loader for your program to run from _asm_exec_ram, then
flip around everything, making a huge temp var, and then copying a
separate prog to $8000 on page 1 to $BFFF on page 2, setting $4000-$7FFF
to page 1, $8000-$BFFF to page 2, and then call $4000.  You could then
have the program designed to start at $4000, so that all the ram
addresses, etc, will be correct.  When the main prog rets back to the
prog at $d748, you could fix it all back, and then ret out to the home
screen like normal - no special loaders to be installed, no shells....

TGaArdvark@aol.com wrote:

> > asm programs are limited to something like 9k or 12k or something.
>
> RAM pages 2-7 are user memory (and the VAT).  Page 1 is a
> scratchpad and the floating-point stack.  Page 0 is used for all
> of the system stuff, like graph mem and mode settings and stuff.
> But the same system stuff that is on that entire 16k page on
> the 86 only took up 4k on the 85 (32 total - 28 user).  The other
> 12k on page 0 is allotted to things not found on the 85.  Stuff
> like the user interrupt area and the asm_exec memory are part
> of this.  In total, exactly 10k of RAM page 0 has been allotted
> to asm_exec.  When you run an assembly program, it is moved
> there and executed.  Since all 10k is on one page, no overlapping
> between pages is possible.  If you try to run a program greater
> than 10k, I believe an error 15 memory will occur.  If not, you
> overwrite the system stack (one of the next things on page 0)
> and crash the calculator.
>
> This brings up the question, is it possible to run a program
> greater than 10k?  Yes, but you can't use the built-in asm()
> command or use any of the current asm shells (because
> all they do is call asm()).  Theoretically, you could have a
> program run by asm() or by a shell that would set RAM
> page 1, copy page 0 and the floating-point stack to user
> memory, copy itself to video_mem, and then copy the
> >10k program to the RAM and execute it.  This would
> give you a limit of 30k for a single program as long as
> you have about 10k of free memory on your calculator.
> The TI-86 cannot run a single program larger than ~30.9k
> because it can only access 32k of RAM and 1k of that is
> video_mem and the ~.1k is the system stack.
>
> This would be a seriously hard job but might be useful.
> Like I said, that's all in theory.  Comments?



--
Stephen Hicks
mailto:shicks@mindspring.com
ICQ:5453914
IRC/AIM:Kupopo
Hopemage:http://www.mindspring.com/~shicks/



References: