[A83] Re: Selfmodifying code [83]


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

[A83] Re: Selfmodifying code [83]




> Van: TypeR unknown <typerfuture@hotmail.com>
> 
> If you do Send9(prgmXXXX on your calc, doesn't it then first execute 
> _exec_assembly (which is in your calc) to check some things in the
> program (like End 0000 End) and only then set the program to the
> memory address 9327h ???

When you do a 'call _exec_assembly' (that's a routine in the ROM) the calc
will lookup the program in OP1, check if it's a valid 'assembly program'
(End:xxxx:End), squish it (ASCII -> hex) and allocate xxxx number of extra
bytes, saves the new 'usermemoffset' and do a jump to $9327 (ld hl,$9327 /
jp (hl)). At return from your program the TIOS deallocates 'usermemoffset'
bytes from $9327.

I *guess* "Send9(prgmXXXX" uses the same routines as Ti provided us. But
there is at least one difference, OP1 holds the name of the BASIC program
(if any) that started your prog. So or the TIOS backups OP1 first and
restores it, or it has a more direct way to acces the squishing/execution
part.

As far as I know the TIOS also does some things like recalculating the
input-buffer (used to store the things you type at the prompt) at return
from your program. On the Ti82 you need to do that sort of things yourself
(or just don't mess with memory), and I have yet to find out how to do it
propperly.

	Henk Poley <><