Re: LZ: variables


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

Re: LZ: variables



At 03:17 PM 7/29/96 -0400, you wrote:
>On Mon, 29 Jul 1996, David Kristensen wrote:
>
>> To try and find a variable, I would have to search the vat for the address
>> by searching for the type and name, right? Does anyone have a better idea of
>> how to do this, or at least an optimized routine for it? I haven't messed
>> with variables, but I know some people have (such as Chris Busch and his
>> CENGINE and SENGINE). If anyone does know any more about variables, please
>> help me.
>
>You use rst 10h, which will find variables in memory.  I am working on a
>program that uses variables, but I've been unable to get anything working.
>I think the following code works; if it doesn't, someone please tell me
>what's wrong.
>
>	ld de, (PROGRAM_ADDR)
>	ld hl, VarStruct
>	add hl, de		;get absolute address of VarStruct
>	rst 20h		; move ten bytes from (hl) to search buffer
>	rst 10h
>	; rest of code goes here...hl should hold address of variable
>
>VarStruct:
>	.db 0,7,"varname "	;real number named varname
>
>
>	-Shmuel
>--
><a href="mailto:shmuelp@poboxes.com">mailto:shmuelp@poboxes.com</a>     http://www.netforward.com/POBoxes/?shmuelp
>
>
Ok, I have a few questions on this one. Is there a list or some help files
on these rst instructions? I have personally never used them or even known
what they do. They might be in ti-ram or ti-rom.txt, but if they are I don't
think that they work with roms 9.0 or above (since I have 9.0...would it
even work on my calc? That does bring up a portability problem if not).
Also, what is the VarStruct format - I assume varname is the name of the
program, 7 is the type of variable-real, string, whatever-but what's the 0
for? Also, how would you use this address, then? Could you first define some
data, then jump to the other program using the absolute address? If so, when
you returned from the program, it would go back to zshell, right? (It
should, but I don't know for sure, so...)


David Kristensen at the University of Missouri - Kansas City
dkristensen@cctr.umkc.edu


The Mind conquers All...


Follow-Ups: References: