Re: A92: Reading a table or a matrix
[Prev][Next][Index][Thread]
Re: A92: Reading a table or a matrix
-
To: assembly-92@lists.ticalc.org
-
Subject: Re: A92: Reading a table or a matrix
-
From: jean-baptiste-andre canazzi <Jean-Baptiste-Andre.Canazzi@epita.fr>
-
Date: Wed, 14 Apr 1999 15:38:37 +0000 (GMT)
-
Delivered-To: assembly-92-outgoing@towerguard.unix.edu.sollentuna.se
-
Delivered-To: assembly-92@lists.ticalc.org
-
Function: Computer Science Student
-
In-Reply-To: <3714921E.DAE7EFBD@infonie.Fr> from "Max" at Apr 14, 1999 03:03:26 PM
-
Operating-System: definitely UNIX
-
Organization: Epita (French Computer Science school)
-
Postal-Address: 14 rue voltaire, 94270 kremlin bicêtre
-
Reply-To: assembly-92@lists.ticalc.org
According to Max:
>
>
> I have created a matrix like that
>
> dc... 0,0,0,0,0,0,0,0
> .... 0,0,0,0,0,1,0,0
>
> Can somebody explain me how can i read the "1" (or another thing) in
> this table...
> P.S.(si vous parlez francais c'est mieux... Repo,dez directe à
> dir@infonie.fr)
>
>
Let's say that you want to put the (row,column) indicated by (d0,d1) in d2.
Let's say that a0 point the matrix.
You can put (d0,d1) in d2 by doing the following :
lsl.w #3,d0
add.w d0,d1
move.b 0(a0,d0.w),d2
Notice that the rows as well as the columns start at 0.
For example, if you want to read the "1", you have to first do the following :
move.w #1,d0
move.w #5,d1
[then call the routine above]
Hope it will help.
--
Jean-Baptiste CANAZZI
canazz_j@epita.fr
http://www.multimania.com/bloozed
References: