[A83] storing op1 to list
[Prev][Next][Index][Thread]
[A83] storing op1 to list
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