comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne Hibou57" <yannick_duchene@yahoo.fr>
Subject: Re: Performance of access type : a tiny mistake in the WikiBook ?
Date: Thu, 8 Oct 2009 23:14:32 -0700 (PDT)
Date: 2009-10-08T23:14:32-07:00	[thread overview]
Message-ID: <49732431-8172-47e3-a193-0b79c513ea36@b15g2000yqd.googlegroups.com> (raw)
In-Reply-To: 7b46a937-2b10-4ef4-b113-3e129747ca5e@o36g2000vbl.googlegroups.com

On 8 oct, 21:41, Gautier write-only <gautier_niou...@hotmail.com>
wrote:
> Sure, for instance Aonix ObjectAda 7.2.2 SE (release mode, optim.
> level 2) compiles this (P_in defined as above)...
>   P_in(i,s);
>   P_in(5678,s);
>   P_in(6789,"direct!");
> into...
>    22| 000024 00000000
>    22| 000028 8B4D                        MOV    ECX, [EBP-8]
>    22| 00002A F8
>    22| 00002B 894D                        MOV    [EBP-12], ECX ;  i
>    22| 00002D F4
> ;  Source Line # 23
>    23| 00002E 68                          PUSH   __lcl.00000002
>    23| 00002F 00000000
>    23| 000033 8D55                        LEA    EDX, [EBP-4] ;  s
>    23| 000035 FC
>    23| 000036 52                          PUSH   EDX
>    23| 000037 51                          PUSH   ECX
>    23| 000038 E8                          CALL   test_in_out.p_in
>    23| 000039 00000000
> ;  Source Line # 24
>    24| 00003D 68                          PUSH   __lcl.00000002
>    24| 00003E 00000000
>    24| 000042 8D75                        LEA    ESI, [EBP-4] ;  s
>    24| 000044 FC
>    24| 000045 56                          PUSH   ESI
>    24| 000046 68                          PUSH   5678
>    24| 000047 2E160000
>    24| 00004B E8                          CALL   test_in_out.p_in
>    24| 00004C 00000000
> ;  Source Line # 25
>    25| 000050 68                          PUSH   __lcl.00000004
>    25| 000051 00000000
>    25| 000055 68                          PUSH   __lcl.00000003
>    25| 000056 00000000
>    25| 00005A 68                          PUSH   6789
>    25| 00005B 851A0000
>    25| 00005F E8                          CALL   test_in_out.p_in
>    25| 000060 00000000

Thanks for the Gesture :)

It's a long time I haven't seen a LEA (load effective address) in an
assembly listing

That's strange : the opcode 16#E8# stands for a Call instruction which
is encoded with a relative offset, and the relative offset is always
zero (16#00000000#) here, whatever is the location of the Call
instance. It's funny (there must be a trick somewhere).



  reply	other threads:[~2009-10-09  6:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-07 20:59 Performance of access type : a tiny mistake in the WikiBook ? Hibou57 (Yannick Duchêne)
2009-10-07 22:38 ` (see below)
2009-10-07 23:30   ` Yannick Duchêne Hibou57
2009-10-08  0:30     ` (see below)
2009-10-08  0:48       ` Yannick Duchêne Hibou57
2009-10-08  9:11         ` Dmitry A. Kazakov
2009-10-08  9:55         ` Gautier write-only
2009-10-08 16:04           ` Yannick Duchêne Hibou57
2009-10-08 16:46             ` Yannick Duchêne Hibou57
2009-10-08 19:41             ` Gautier write-only
2009-10-09  6:14               ` Yannick Duchêne Hibou57 [this message]
2009-10-09 18:51                 ` sjw
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox