Re: A83: Re: Matrices and Lists...


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

Re: A83: Re: Matrices and Lists...




As long as you don't need to change the size (number of elements) of the
list, sure!  The list beginns with two bytes specifying how many elements
there are.  Then, the elements follow.  Each element is 9 bytes long and
holds a floating point number (see www.ticalc.org -> programming -> asm->
ti-83 -> basic design).  If you want to store normal integers here, you can
do that like this: (Assuming we have a list which already contains at least
one element)

   ...some code to find the list. The address of the list is now in hl...

   inc   hl
   inc   hl      ; Get past the number-of-elements stuff

   ld    (hl),0  ; Clear the first byte of those 9 bytes (this byte should
                 ; always be zero, to prevent confusing the calculator).
   inc   hl

   ld    a,123d  ; You could use some other way of setting "a"

   ld    (hl),a  ; Store "a" to the list.

To retrieve the value, do like this (list pointer in hl):

   inc   hl
   inc   hl      ; Get past the number-of-elements stuff

   inc   hl      ; Assume we have a zero here, just skip it.

   ld    a,(hl)  ; Get the data


Linus

On 25-Apr-98, James Matthews wrote:

>Linus:

>Cool!  You know anything about writing, or reading, from lists?

>James.

>____________________

>James Matthews.
>E-mail (family):    matthews@tkb.att.ne.jp
>E-mail (private):  james_matthews@hotmail.com

>Homepage:  http://home.att.ne.jp/gold/tomcat21/index2.html
>ICQ:  7413754
>____________________________________

>----------
>> From: Linus Akesson <lairfight@softhome.net>
>> To: Trey Jazz <assembly-83@lists.ticalc.org>
>> Subject: Re: A83: Re: Matrices and Lists...
>> Date: Friday, April 24, 1998 5:57 AM
>> 
>> 
>> I don't know about rst 10h, but _CHKFINDSYM wants this for a list name:
>> .db 1,5dh,"NAME",0
>> 1 is the type (list). This is so that it won't return the address of
>prgmNAME.
>> Use 5 for programs.
>> 5d is used inside the VAT to indicate lists. It might be the small 'L'.
>> 
>> I've found this out using memdumps and try'n'error, so there might be
>better
>> ways (like your rst instruction f.ex. Know any other interesting rst
>> addresses?)
>> 
>> Linus
>> 
>> On 23-Apr-98, Trey Jazz wrote:
>> 
>> >this _should_ work tell me if it doesnt
>> 
>> >ld hl,list_info-1    ;puts the string into hl
>> > rst 20h                ;puts the string into OP1
>> > rst 10h                ;find sym...use this to look through the VAT to
>see
>> >if it exists
>> > jp c,no_variable ;it doesnt exist if the carry is set
>> >;it exists so ahl points to the start of data in the list or matrix
>> >;do whatever you want with the data...
>> >no_variable:
>> > ret
>> 
>> >list_info:
>> >.db 4,"list"            ;length of name of the list, the list name
>> >mat_info:
>> > .db 6,"matrix"     ;same here
>> 
>> 
>> >-----Original Message-----
>> >From: James Matthews <matthews@tkb.att.ne.jp>
>> >To: Asm Help <assembly-83@lists.ticalc.org>
>> >Date: Thursday, April 23, 1998 9:25 AM
>> >Subject: A83: Matrices and Lists...
>> 
>> 
>> >>
>> >>Ok, this is my LAST attempt...and is directed at the master programmers
>> >>like Movax (who posted recently...I know you're out there :)
>> >>
>> >>HOW DO YOU ACCESS THE TI MATRICES AND LISTS WITH ASM?!  Please someone
>help
>> >>me...
>> >>
>> >>James.
>> >>
>> >>____________________
>> >>
>> >>James Matthews.
>> >>E-mail (family):    matthews@tkb.att.ne.jp
>> >>E-mail (private):  james_matthews@hotmail.com
>> >>
>> >>Homepage:  http://home.att.ne.jp/gold/tomcat21/index2.html
>> >>ICQ:  7413754
>> >>____________________________________
>> >>
>> 
>> 
>> 



References: