RE: assembly
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 08, 2001
- 380 views
----- Original Message ----- From: "Jiri Babor" <jbabor at PARADISE.NET.NZ> To: "EUforum" <EUforum at topica.com> Subject: Re: RE: assembly > -- decompose phl sequence - try something like this: > > a = repeat(0, 256) > x1 = a > x2 = a > y1 = a > y2 = a > > for b = 1 to 256 do > a = phl[b][2] > x1 = phl[b][1][1] - 2 > x1 = phl[b][1][2] - 2 > x1 = phl[b][1][1] + 1 > x1 = phl[b][1][2] + 1 > end for > > > -- then one level indexing is MUCH faster: > > for b = 1 to 256 do > if a[b] = i then > ellipse(a[b], 1, {x1[b], y1[b]}, {x2[b], y2[b]}) > end if > end for > Another optimisation could be to eliminate the sequence forming in the ellipse call at run time. a = repeat(0, 256) xy1 = repeat({0,0}, 256) xy2 = repeat({0,0}, 256) for b = 1 to 256 do a[b] = phl[b][2] xy1[b][1] = phl[b][1][1] - 2 xy1[b][2] = phl[b][1][2] - 2 xy2[b][1] = phl[b][1][1] + 1 xy2[b][2] = phl[b][1][2] + 1 end for -- then one level indexing is MUCH faster: for b = 1 to 256 do if a[b] = i then ellipse(a[b], 1, xy1[b], xy2[b]) end if end for ----------- But back to the original question. To do this using assembly code would require that you know the internal layout of sequences and that is not published and may change from release to release. Instead you would have to store the coordinates in RAM arrays rather than sequences. --------- Derek