Re: LZ: variables


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

Re: LZ: variables



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
<pre>
--
<a href="mailto:shmuelp@poboxes.com">mailto:shmuelp@poboxes.com</a>     http://www.netforward.com/POBoxes/?shmuelp
</pre>


References: