[A83] Re: PLEASE HELP ME!!!Re: storing op1 to list


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

[A83] Re: PLEASE HELP ME!!!Re: storing op1 to list




Saving the start location of the list is not a reliable method in many
cases.  If you do any more fuddling with memory (creating or deleting
variables, inserting or deleting bytes, etc) after creating the variable, it
may move around in memory.  What you should do is actually look up the
variable again using FindSym directly before you're going to load the data
to it (unless you can be sure it's not going to move around in memory).

Also, not a bug, just an optimization suggestion.  You can use the MovFrOP1
entry point to copy 9 bytes from OP1 to DE.  It would save you a few bytes.

-Dan Englender

----- Original Message -----
From: "TypeR unknown" <typerfuture@hotmail.com>
To: <assembly-83@lists.ticalc.org>
Sent: Tuesday, August 28, 2001 1:10 PM
Subject: [A83] PLEASE HELP ME!!!Re: storing op1 to list


>
> Come on, somebody must know about this!!!
> I'm not kidding, I'm really stuck about this!!!
>
> >From: "TypeR unknown" <typerfuture@hotmail.com>
> >Reply-To: assembly-83@lists.ticalc.org
> >To: assembly-83@lists.ticalc.org
> >Subject: [A83] storing op1 to list
> >Date: Fri, 24 Aug 2001 19:28:31 +0200
> >
> >
> >I have this program where in the beginning of the program two lists are
> >created, named ZG1 and ZG2.
> >In testing I have used the number 5 for the number of element's they both
> >contain.
> >
> >Later in the program I have to write the number which is in op1 to a
> >element in list ZG1, to do this I have used the code as given in ASMGURU
> >(tut 31 I believe)
> >It goes like this:
> >
> >    ld hl,1 ;write to element 1
> >    call _adrlele ;calculate element address
> >    ex de,hl  ;de->element address
> >    ld hl,op1 ;hl-> number
> >    ld bc,9
> >    ldir   ;store to element
> >
> >but because there is a lot of code between creating the list and actually
> >writing to it, as far as I know, I must preserve the de register because
> >this contains the list element.
> >
> >So I have saved de with two user defined variables (not good but I think
> >reliable), but the program doesn't work well, because it doesn't store
the
> >number!!!
> >
> >Should I be preserving more registers, or is the something wrong with my
> >code??
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >_________________________________________________________________
> >Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp
> >
> >
> >
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>





References: