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


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

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




> 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?


Follow-Ups: