multi dimensional array example

S

Skybuck Flying

Try accessing the arrays in the same order. Your C program is varying

Oh sorry, I was in a hurry..

I should have posted the worst case code.. instead of the best case code..

Well nothing a new post can't fix... here is the worst case delphi version:

Project1.dpr.350: begin
00409CEC 55 push ebp
00409CED 8BEC mov ebp,esp
00409CEF 83C4D8 add esp,-$28
00409CF2 53 push ebx
00409CF3 33C0 xor eax,eax
00409CF5 8945FC mov [ebp-$04],eax
00409CF8 33C0 xor eax,eax
00409CFA 55 push ebp
00409CFB 68DE9D4000 push $00409dde
00409D00 64FF30 push dword ptr fs:[eax]
00409D03 648920 mov fs:[eax],esp
Project1.dpr.353: SetLength( vArray, 200, 200, 200 );
00409D06 68C8000000 push $000000c8
00409D0B 68C8000000 push $000000c8
00409D10 68C8000000 push $000000c8
00409D15 8D45FC lea eax,[ebp-$04]
00409D18 B903000000 mov ecx,$00000003
00409D1D 8B15B49C4000 mov edx,[$00409cb4]
00409D23 E888B4FFFF call @DynArraySetLength
00409D28 83C40C add esp,$0c
Project1.dpr.355: vLongTick1 := GetTickCount;
00409D2B E800C0FFFF call GetTickCount
00409D30 33D2 xor edx,edx
00409D32 8945E8 mov [ebp-$18],eax
00409D35 8955EC mov [ebp-$14],edx
Project1.dpr.359: for x := 0 to 199 do
00409D38 33C9 xor ecx,ecx
Project1.dpr.361: for y := 0 to 199 do
00409D3A 33D2 xor edx,edx
Project1.dpr.363: for z := 0 to 199 do
00409D3C 33C0 xor eax,eax
Project1.dpr.365: vArray[ z, x, y ] := 123456789;
00409D3E 8B5DFC mov ebx,[ebp-$04]
00409D41 8B1C83 mov ebx,[ebx+eax*4]
00409D44 8B1C8B mov ebx,[ebx+ecx*4]
00409D47 C7049315CD5B07 mov [ebx+edx*4],$075bcd15
Project1.dpr.366: end;
00409D4E 40 inc eax
Project1.dpr.363: for z := 0 to 199 do
00409D4F 3DC8000000 cmp eax,$000000c8
00409D54 75E8 jnz $00409d3e
Project1.dpr.367: end;
00409D56 42 inc edx
Project1.dpr.361: for y := 0 to 199 do
00409D57 81FAC8000000 cmp edx,$000000c8
00409D5D 75DD jnz $00409d3c
Project1.dpr.368: end;
00409D5F 41 inc ecx
Project1.dpr.359: for x := 0 to 199 do
00409D60 81F9C8000000 cmp ecx,$000000c8
00409D66 75D2 jnz $00409d3a
Project1.dpr.370: vLongTick2 := GetTickCount;
00409D68 E8C3BFFFFF call GetTickCount
00409D6D 33D2 xor edx,edx
00409D6F 8945E0 mov [ebp-$20],eax
00409D72 8955E4 mov [ebp-$1c],edx
Project1.dpr.373: if vLongTick2 < vLongTick1 then
00409D75 8B45E0 mov eax,[ebp-$20]
00409D78 8B55E4 mov edx,[ebp-$1c]
00409D7B 3B55EC cmp edx,[ebp-$14]
00409D7E 7507 jnz $00409d87
00409D80 3B45E8 cmp eax,[ebp-$18]
00409D83 7311 jnb $00409d96
00409D85 EB02 jmp $00409d89
00409D87 7D0D jnl $00409d96
Project1.dpr.375: vLongTick2 := vLongTick2 + 4294967296;
00409D89 8B45E0 mov eax,[ebp-$20]
00409D8C 8B55E4 mov edx,[ebp-$1c]
00409D8F 42 inc edx
00409D90 8945E0 mov [ebp-$20],eax
00409D93 8955E4 mov [ebp-$1c],edx
Project1.dpr.380: vInterval := vLongTick2 - vLongTick1;
00409D96 8B45E0 mov eax,[ebp-$20]
00409D99 8B55E4 mov edx,[ebp-$1c]
00409D9C 2B45E8 sub eax,[ebp-$18]
00409D9F 1B55EC sbb edx,[ebp-$14]
00409DA2 8945D8 mov [ebp-$28],eax
00409DA5 8955DC mov [ebp-$24],edx
Project1.dpr.383: vArray := nil;
00409DA8 8D45FC lea eax,[ebp-$04]
00409DAB 8B15B49C4000 mov edx,[$00409cb4]
00409DB1 E806B4FFFF call @DynArrayClear
Project1.dpr.386: result := vInterval;
00409DB6 8B45D8 mov eax,[ebp-$28]
00409DB9 8945F0 mov [ebp-$10],eax
00409DBC 8B45DC mov eax,[ebp-$24]
00409DBF 8945F4 mov [ebp-$0c],eax
Project1.dpr.387: end;
00409DC2 33C0 xor eax,eax

Admire, be dazzled and witness the Delphi goodness :p* ;) =D WIE.

Bye,
Skybuck
 
R

robertwessel2

Skybuck said:
Oh sorry, I was in a hurry..

I should have posted the worst case code.. instead of the best case code..

Well nothing a new post can't fix... here is the worst case delphi version:


And the point of this post is? Are there some results of significance?

Project1.dpr.350: begin
(...)
Admire, be dazzled and witness the Delphi goodness :p* ;) =D WIE.


Not likely.
 
A

Alex Buell

And the point of this post is? Are there some results of
significance?

He's a Pascal zealot. But he does have a valid point; Pascal can
generate highly optimised code. I remember the old TurboPascal days.

However, C++'s far more interesting to code with...
Not likely.

Delpi? Ugh. Bloatware compared to TurboPascal.
 
J

Jim P

Mark said:
and I second that motion

Skybuck is just after causing issues and effects and will push anything
to the limit - - like he tried with me a few months ago

and that made a total fool of himself - - trying and trying to prove his
idea had some worth - -

and got more crazy in his responses to try to prove it - - -

best to just let him go and not get the response that he wants.

and that is any response at all - - including even this one

Jim P.
 
S

Skybuck Flying

Jim P said:
and I second that motion

Skybuck is just after causing issues and effects and will push anything to
the limit - - like he tried with me a few months ago

and that made a total fool of himself - - trying and trying to prove his
idea had some worth - -

and got more crazy in his responses to try to prove it - - -

best to just let him go and not get the response that he wants.

and that is any response at all - - including even this one

Try alt.nag.newsgroup.

Bye,
Skybuck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top