A82: Re: self modifying


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

A82: Re: self modifying




>ok, i want to mod my code to the extreme, and i was wondering... does
>crash and/or ash have aial storage area to remember how many bytes to
>relocate?


Yes. A pointer to the program and the length is stored before the program
is relocated.

>ie, a prog is 1000 bytes, does it store the #1000 somewhere so i knows
how
>much to move?


Yes.

>or does it just look at the first word of the prog and move that back?


No.

>if i alter the prog to be 200 bytes smaller, then fix the addresses, can
i
>just change the first 2 bytes to the new size, or will the shell/ti-os
>bitch about it?


You need to do a lot more to change the size of your program. If you just
change the size byte the TI-OS will tell you that your program is 200
bytes smaller, but it will still be taking up 1000. The problem is that
the ROM does not contain a resizeing routine, since the TI-OS never
resizes a var ! On the TI85 i found a routine which can be used to resize
a var (this is the one used in Usgard), and I have found it on the TI82
too (but never tested it). So to resize your var you need to derelocate
your program, call the resize routine and then relocate your program
again. This will be possible in Ash 3.1, but it is not possible in Ash 3.0
or CrASH.

Dines

_______________________________________

Dines Justesen
Email: dines@post1.com or
       c958362@student.dtu.dk
WWW  : http://www.gbar.dtu.dk/~c958362/
_______________________________________