Re: A92: Arrays.
[Prev][Next][Index][Thread]
Re: A92: Arrays.
Vives schrieb:
> Can somebody tell me how to declare an array of 2 dimensions for Fargo 2.
> I looked in the Newbies Guide and Jimmy Mardel's Guide, but I made a try and
> it doesn't work.
> If someone could explain me how it works...
Well, you should declare a var with enough space (here 128 bytes):
array ds.b 2*128
index dc.w 0
then you can use it with indirect addressing and offset:
lea array(pc),a0
move.w index(pc),d0
lsl.w #1,d0 ;multiply by two
move.b 0(a0,d0.w),d1 ;x-position
move.b 1(a0,d0.w),d2 ;y-position
Data can be stored there in the same way, take care of indices starting at 0.
A.K.
>
> Thanx.
> VIVES Fabien
> "SWITCH"
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
> <HTML>
> <HEAD>
>
> <META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
> <META content='"MSHTML 4.71.1712.3"' name=GENERATOR>
> </HEAD>
> <BODY bgColor=#ffffff>
> <DIV><FONT size=2>Can somebody tell me how to declare an array of 2
> dimensions
> for Fargo 2.</FONT></DIV>
> <DIV><FONT size=2>I looked in the Newbies Guide and Jimmy Mardel's Guide, but
> I
> made a try and it doesn't work.</FONT></DIV>
> <DIV><FONT size=2>If someone could explain me how it works...</FONT></DIV>
> <DIV><FONT size=2></FONT> </DIV>
> <DIV><FONT size=2>Thanx.</FONT></DIV>
> <DIV><FONT size=2>VIVES Fabien </FONT></DIV>
> <DIV><FONT size=2>"SWITCH"</FONT></DIV></BODY></HTML>
>
References: