Leigh

Had a chuckle at Dennis's post :-)

If you are trying to optimise code you could try compiling

  fMyRecord.fLength := 0;
  fMyRecord.fCount := fMyRecord.fLength;
  fMyRecord.fReadOnly := False;

Neven


----- Original Message ----- 
From: "Leigh Wanstead" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Tuesday, June 17, 2003 11:43 AM
Subject: [DUG]: Delphi optimizer


> Hello everyone,
>
> I was surprised that Delphi 7 generate following asmbler code for this
> pascal code. I have turned on Code generation/Optimization.
>
>   fMyRecord.fLength := 0;
>   fMyRecord.fCount := 0;
>   fMyRecord.fReadOnly := False;
>
> xor edx, edx
> mov [eax+$2fc], edx
>
> xor edx, edx
> mov [eax+$300], edx
>
> mov byte ptr [eax+$304], $0
>
> I think the optimized asm code will look like this.
>
> xor edx, edx
> mov [eax+$2fc], edx
> mov [eax+$300], edx
> mov [eax+$304], edx
>
> I tested the hand written asm code, it is 5 cpu clock cycle faster. I hate
> to put asm in my source code. So the question is how to write delphi code
to
> generate optimize asm code like this one.
>
> I know this slow down may not sound that much, just for research purpose.
>
> I have enclosed delphi sample code for your reference. I look forward to
> hearing from you.
>
> TIA
>
> Best Regards
> Leigh
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to