Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Difference between Portable Executable (PE) file and a Assembly

Reply
Thread Tools

Difference between Portable Executable (PE) file and a Assembly

 
 
=?Utf-8?B?c3VyZXNoX0Mj?=
Guest
Posts: n/a
 
      05-01-2005
Dear All,

What is difference between Portable Executable (PE) file and a Assembly?

Thanks,
Mahesh



 
Reply With Quote
 
 
 
 
Ben Fidge
Guest
Posts: n/a
 
      05-01-2005
PE is the name given to standard 32 bit Windows executables and defined the
structure of the .exe file format. These files contain header information,
resource and the raw machine code compiled from an applications souirce
code.

An assembly on the other hand can be a dll or exe file compiled using a .NET
compiler and actually contain pseudo assembly code called IL, or
Intermediary Language. IL was devised by Microsoft to promote cross-platform
compatibility.

When an assembly is first executed, JIT compiling (Just-in-time) is invoked
and the assembly is then compiled using platofrm specific compilers to turn
the IL into native machine code specific to the platform on which it's
running. In principle, the same assembly can run on any platform that
supports the .NET Framework and has it's own JIT compiler.

That's my understanding of it.

Ben Fidge

"suresh_C#" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear All,
>
> What is difference between Portable Executable (PE) file and a Assembly?
>
> Thanks,
> Mahesh
>
>
>



 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      05-01-2005
Hi Mahesh:

PE is a file format.

An assembly is the smallest unit of deployment for .NET applications
and consist of one or more modules. These modules use the PE file
format.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 1 May 2005 12:17:05 -0700, suresh_C#
<(E-Mail Removed)> wrote:

>Dear All,
>
>What is difference between Portable Executable (PE) file and a Assembly?
>
>Thanks,
>Mahesh
>
>


 
Reply With Quote
 
=?Utf-8?B?c3VyZXNoX0Mj?=
Guest
Posts: n/a
 
      05-01-2005

Thanks Ben, Thanks Scott.

But, following is definition of Ilasm.exe
--
When you compile managed code, the compiler converts the source code to MSIL
code. MSIL is a CPU-independent language and its code can be converted to
native code. ***You can use the Ilasm tool, Ilasm.exe, to generate a portable
executable file from the MSIL code. *** You can then run the resulting
executable file to determine the performance of your application. This
enables you to generate the MSIL code and the metadata without emitting MSIL
in the portable executable file format. In addition, Ilasm.exe does not
create intermediate object files. It also does not have a linking stage to
generate a portable executable file.
--

***You can use the Ilasm tool, Ilasm.exe, to generate a portable executable
file from the MSIL code. ***

Considering this point, I think it generates a portable executable file (
??? different file ) from the MSIL code (Assembly ???)

Am I right? If right please I don’t understand what is PE and why it is used
then.



"Scott Allen" wrote:

> Hi Mahesh:
>
> PE is a file format.
>
> An assembly is the smallest unit of deployment for .NET applications
> and consist of one or more modules. These modules use the PE file
> format.
>
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>
> On Sun, 1 May 2005 12:17:05 -0700, suresh_C#
> <(E-Mail Removed)> wrote:
>
> >Dear All,
> >
> >What is difference between Portable Executable (PE) file and a Assembly?
> >
> >Thanks,
> >Mahesh
> >
> >

>
>

 
Reply With Quote
 
Ben Fidge
Guest
Posts: n/a
 
      05-01-2005
Yes you are right, a PE executable is created from the IL. PE is the file
format used to define 32bit Windows Executables. This is the native format
used by Windows. As mentioned, your .NET assembly is first compiled to IL
which is a platform independant assembly language. This is then compiled
into the platform specific binary, which for us Windows developers is called
PE.

PE has been around since the first versions of Windows NT and all versions
of Windows since Win95 have also been made to expect that particular format
to store binary executables. Obviously, as no current processors know how to
execute IL, it needs recompiling for the processor and platform it's running
on.

For more info on the format have a look here:

http://www.wotsit.org/search.asp?page=2&s=binary



"suresh_C#" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Thanks Ben, Thanks Scott.
>
> But, following is definition of Ilasm.exe
> --
> When you compile managed code, the compiler converts the source code to
> MSIL
> code. MSIL is a CPU-independent language and its code can be converted to
> native code. ***You can use the Ilasm tool, Ilasm.exe, to generate a
> portable
> executable file from the MSIL code. *** You can then run the resulting
> executable file to determine the performance of your application. This
> enables you to generate the MSIL code and the metadata without emitting
> MSIL
> in the portable executable file format. In addition, Ilasm.exe does not
> create intermediate object files. It also does not have a linking stage to
> generate a portable executable file.
> --
>
> ***You can use the Ilasm tool, Ilasm.exe, to generate a portable
> executable
> file from the MSIL code. ***
>
> Considering this point, I think it generates a portable executable file (
> ??? different file ) from the MSIL code (Assembly ???)
>
> Am I right? If right please I don't understand what is PE and why it is
> used
> then.
>
>
>
> "Scott Allen" wrote:
>
>> Hi Mahesh:
>>
>> PE is a file format.
>>
>> An assembly is the smallest unit of deployment for .NET applications
>> and consist of one or more modules. These modules use the PE file
>> format.
>>
>> --
>> Scott
>> http://www.OdeToCode.com/blogs/scott/
>>
>> On Sun, 1 May 2005 12:17:05 -0700, suresh_C#
>> <(E-Mail Removed)> wrote:
>>
>> >Dear All,
>> >
>> >What is difference between Portable Executable (PE) file and a Assembly?
>> >
>> >Thanks,
>> >Mahesh
>> >
>> >

>>
>>

>



 
Reply With Quote
 
=?Utf-8?B?c3VyZXNoX0Mj?=
Guest
Posts: n/a
 
      05-01-2005

Thanks Ben. This is clear to me now.

I would be grateful if you answer to this question also.

I assume that JIT compiler and Ilasm.exe convert the IL code into machine
dependent code.

I knew that there are 2 tools ie JIT and one more tool [I forgot name] which
do the above. Then in .NET who uses the Ilasm.exe tool.



"Ben Fidge" wrote:

> Yes you are right, a PE executable is created from the IL. PE is the file
> format used to define 32bit Windows Executables. This is the native format
> used by Windows. As mentioned, your .NET assembly is first compiled to IL
> which is a platform independant assembly language. This is then compiled
> into the platform specific binary, which for us Windows developers is called
> PE.
>
> PE has been around since the first versions of Windows NT and all versions
> of Windows since Win95 have also been made to expect that particular format
> to store binary executables. Obviously, as no current processors know how to
> execute IL, it needs recompiling for the processor and platform it's running
> on.
>
> For more info on the format have a look here:
>
> http://www.wotsit.org/search.asp?page=2&s=binary
>
>
>
> "suresh_C#" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> > Thanks Ben, Thanks Scott.
> >
> > But, following is definition of Ilasm.exe
> > --
> > When you compile managed code, the compiler converts the source code to
> > MSIL
> > code. MSIL is a CPU-independent language and its code can be converted to
> > native code. ***You can use the Ilasm tool, Ilasm.exe, to generate a
> > portable
> > executable file from the MSIL code. *** You can then run the resulting
> > executable file to determine the performance of your application. This
> > enables you to generate the MSIL code and the metadata without emitting
> > MSIL
> > in the portable executable file format. In addition, Ilasm.exe does not
> > create intermediate object files. It also does not have a linking stage to
> > generate a portable executable file.
> > --
> >
> > ***You can use the Ilasm tool, Ilasm.exe, to generate a portable
> > executable
> > file from the MSIL code. ***
> >
> > Considering this point, I think it generates a portable executable file (
> > ??? different file ) from the MSIL code (Assembly ???)
> >
> > Am I right? If right please I don't understand what is PE and why it is
> > used
> > then.
> >
> >
> >
> > "Scott Allen" wrote:
> >
> >> Hi Mahesh:
> >>
> >> PE is a file format.
> >>
> >> An assembly is the smallest unit of deployment for .NET applications
> >> and consist of one or more modules. These modules use the PE file
> >> format.
> >>
> >> --
> >> Scott
> >> http://www.OdeToCode.com/blogs/scott/
> >>
> >> On Sun, 1 May 2005 12:17:05 -0700, suresh_C#
> >> <(E-Mail Removed)> wrote:
> >>
> >> >Dear All,
> >> >
> >> >What is difference between Portable Executable (PE) file and a Assembly?
> >> >
> >> >Thanks,
> >> >Mahesh
> >> >
> >> >
> >>
> >>

> >

>
>
>

 
Reply With Quote
 
Ben Fidge
Guest
Posts: n/a
 
      05-02-2005
I've never used the ILASM tool day-to-day, only for experimentation.

Referring back to the MS documentation, ILASM is a tool for vendors creating
IL generators. It allows them to concentrate on the actual renderring of IL
from their custom language compilers without the need to write an IL to
machine-code compiler.

I may be wrong but JIT may also use ILASM when compiling IL to native
machine code for the first time, but you may want to check up on this. I
certainly don't consider myself an expert on all thing IL!!

http://msdn.microsoft.com/library/de...erIlasmexe.asp


Ben


"suresh_C#" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Thanks Ben. This is clear to me now.
>
> I would be grateful if you answer to this question also.
>
> I assume that JIT compiler and Ilasm.exe convert the IL code into machine
> dependent code.
>
> I knew that there are 2 tools ie JIT and one more tool [I forgot name]
> which
> do the above. Then in .NET who uses the Ilasm.exe tool.
>
>
>
> "Ben Fidge" wrote:
>
>> Yes you are right, a PE executable is created from the IL. PE is the file
>> format used to define 32bit Windows Executables. This is the native
>> format
>> used by Windows. As mentioned, your .NET assembly is first compiled to IL
>> which is a platform independant assembly language. This is then compiled
>> into the platform specific binary, which for us Windows developers is
>> called
>> PE.
>>
>> PE has been around since the first versions of Windows NT and all
>> versions
>> of Windows since Win95 have also been made to expect that particular
>> format
>> to store binary executables. Obviously, as no current processors know how
>> to
>> execute IL, it needs recompiling for the processor and platform it's
>> running
>> on.
>>
>> For more info on the format have a look here:
>>
>> http://www.wotsit.org/search.asp?page=2&s=binary
>>
>>
>>
>> "suresh_C#" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >
>> > Thanks Ben, Thanks Scott.
>> >
>> > But, following is definition of Ilasm.exe
>> > --
>> > When you compile managed code, the compiler converts the source code to
>> > MSIL
>> > code. MSIL is a CPU-independent language and its code can be converted
>> > to
>> > native code. ***You can use the Ilasm tool, Ilasm.exe, to generate a
>> > portable
>> > executable file from the MSIL code. *** You can then run the resulting
>> > executable file to determine the performance of your application. This
>> > enables you to generate the MSIL code and the metadata without emitting
>> > MSIL
>> > in the portable executable file format. In addition, Ilasm.exe does not
>> > create intermediate object files. It also does not have a linking stage
>> > to
>> > generate a portable executable file.
>> > --
>> >
>> > ***You can use the Ilasm tool, Ilasm.exe, to generate a portable
>> > executable
>> > file from the MSIL code. ***
>> >
>> > Considering this point, I think it generates a portable executable file
>> > (
>> > ??? different file ) from the MSIL code (Assembly ???)
>> >
>> > Am I right? If right please I don't understand what is PE and why it is
>> > used
>> > then.
>> >
>> >
>> >
>> > "Scott Allen" wrote:
>> >
>> >> Hi Mahesh:
>> >>
>> >> PE is a file format.
>> >>
>> >> An assembly is the smallest unit of deployment for .NET applications
>> >> and consist of one or more modules. These modules use the PE file
>> >> format.
>> >>
>> >> --
>> >> Scott
>> >> http://www.OdeToCode.com/blogs/scott/
>> >>
>> >> On Sun, 1 May 2005 12:17:05 -0700, suresh_C#
>> >> <(E-Mail Removed)> wrote:
>> >>
>> >> >Dear All,
>> >> >
>> >> >What is difference between Portable Executable (PE) file and a
>> >> >Assembly?
>> >> >
>> >> >Thanks,
>> >> >Mahesh
>> >> >
>> >> >
>> >>
>> >>
>> >

>>
>>
>>



 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      05-02-2005
ILASM is more of a repackaging tool. It takes IL code and packages the
code into a file in the PE format. If you wrote your own compiler that
generated MSIL, then you could use ILASM to put the MSIL into a
managed executable. ILASM doesn't generate native code.

NGEN.EXE can be used to generate native code for an assembly. I'd only
recommend using NGEN if you have a good reason to avoid JIT compiling.

--
Scott
http://www.OdeToCode.com/blogs/scott/


On Sun, 1 May 2005 15:11:14 -0700, suresh_C#
<(E-Mail Removed)> wrote:

>
>Thanks Ben. This is clear to me now.
>
>I would be grateful if you answer to this question also.
>
>I assume that JIT compiler and Ilasm.exe convert the IL code into machine
>dependent code.
>
>I knew that there are 2 tools ie JIT and one more tool [I forgot name] which
>do the above. Then in .NET who uses the Ilasm.exe tool.
>
>
>
>"Ben Fidge" wrote:
>
>> Yes you are right, a PE executable is created from the IL. PE is the file
>> format used to define 32bit Windows Executables. This is the native format
>> used by Windows. As mentioned, your .NET assembly is first compiled to IL
>> which is a platform independant assembly language. This is then compiled
>> into the platform specific binary, which for us Windows developers is called
>> PE.
>>
>> PE has been around since the first versions of Windows NT and all versions
>> of Windows since Win95 have also been made to expect that particular format
>> to store binary executables. Obviously, as no current processors know how to
>> execute IL, it needs recompiling for the processor and platform it's running
>> on.
>>
>> For more info on the format have a look here:
>>
>> http://www.wotsit.org/search.asp?page=2&s=binary
>>
>>
>>
>> "suresh_C#" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >
>> > Thanks Ben, Thanks Scott.
>> >
>> > But, following is definition of Ilasm.exe
>> > --
>> > When you compile managed code, the compiler converts the source code to
>> > MSIL
>> > code. MSIL is a CPU-independent language and its code can be converted to
>> > native code. ***You can use the Ilasm tool, Ilasm.exe, to generate a
>> > portable
>> > executable file from the MSIL code. *** You can then run the resulting
>> > executable file to determine the performance of your application. This
>> > enables you to generate the MSIL code and the metadata without emitting
>> > MSIL
>> > in the portable executable file format. In addition, Ilasm.exe does not
>> > create intermediate object files. It also does not have a linking stage to
>> > generate a portable executable file.
>> > --
>> >
>> > ***You can use the Ilasm tool, Ilasm.exe, to generate a portable
>> > executable
>> > file from the MSIL code. ***
>> >
>> > Considering this point, I think it generates a portable executable file (
>> > ??? different file ) from the MSIL code (Assembly ???)
>> >
>> > Am I right? If right please I don't understand what is PE and why it is
>> > used
>> > then.
>> >
>> >
>> >
>> > "Scott Allen" wrote:
>> >
>> >> Hi Mahesh:
>> >>
>> >> PE is a file format.
>> >>
>> >> An assembly is the smallest unit of deployment for .NET applications
>> >> and consist of one or more modules. These modules use the PE file
>> >> format.
>> >>
>> >> --
>> >> Scott
>> >> http://www.OdeToCode.com/blogs/scott/
>> >>
>> >> On Sun, 1 May 2005 12:17:05 -0700, suresh_C#
>> >> <(E-Mail Removed)> wrote:
>> >>
>> >> >Dear All,
>> >> >
>> >> >What is difference between Portable Executable (PE) file and a Assembly?
>> >> >
>> >> >Thanks,
>> >> >Mahesh
>> >> >
>> >> >
>> >>
>> >>
>> >

>>
>>
>>


 
Reply With Quote
 
=?Utf-8?B?TWFoZXNoIE5pbWJhbGthcg==?=
Guest
Posts: n/a
 
      05-03-2005
Thanks Scott, thanks Ben.

"Scott Allen" wrote:

> ILASM is more of a repackaging tool. It takes IL code and packages the
> code into a file in the PE format. If you wrote your own compiler that
> generated MSIL, then you could use ILASM to put the MSIL into a
> managed executable. ILASM doesn't generate native code.
>
> NGEN.EXE can be used to generate native code for an assembly. I'd only
> recommend using NGEN if you have a good reason to avoid JIT compiling.
>
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>
>
> On Sun, 1 May 2005 15:11:14 -0700, suresh_C#
> <(E-Mail Removed)> wrote:
>
> >
> >Thanks Ben. This is clear to me now.
> >
> >I would be grateful if you answer to this question also.
> >
> >I assume that JIT compiler and Ilasm.exe convert the IL code into machine
> >dependent code.
> >
> >I knew that there are 2 tools ie JIT and one more tool [I forgot name] which
> >do the above. Then in .NET who uses the Ilasm.exe tool.
> >
> >
> >
> >"Ben Fidge" wrote:
> >
> >> Yes you are right, a PE executable is created from the IL. PE is the file
> >> format used to define 32bit Windows Executables. This is the native format
> >> used by Windows. As mentioned, your .NET assembly is first compiled to IL
> >> which is a platform independant assembly language. This is then compiled
> >> into the platform specific binary, which for us Windows developers is called
> >> PE.
> >>
> >> PE has been around since the first versions of Windows NT and all versions
> >> of Windows since Win95 have also been made to expect that particular format
> >> to store binary executables. Obviously, as no current processors know how to
> >> execute IL, it needs recompiling for the processor and platform it's running
> >> on.
> >>
> >> For more info on the format have a look here:
> >>
> >> http://www.wotsit.org/search.asp?page=2&s=binary
> >>
> >>
> >>
> >> "suresh_C#" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> >
> >> > Thanks Ben, Thanks Scott.
> >> >
> >> > But, following is definition of Ilasm.exe
> >> > --
> >> > When you compile managed code, the compiler converts the source code to
> >> > MSIL
> >> > code. MSIL is a CPU-independent language and its code can be converted to
> >> > native code. ***You can use the Ilasm tool, Ilasm.exe, to generate a
> >> > portable
> >> > executable file from the MSIL code. *** You can then run the resulting
> >> > executable file to determine the performance of your application. This
> >> > enables you to generate the MSIL code and the metadata without emitting
> >> > MSIL
> >> > in the portable executable file format. In addition, Ilasm.exe does not
> >> > create intermediate object files. It also does not have a linking stage to
> >> > generate a portable executable file.
> >> > --
> >> >
> >> > ***You can use the Ilasm tool, Ilasm.exe, to generate a portable
> >> > executable
> >> > file from the MSIL code. ***
> >> >
> >> > Considering this point, I think it generates a portable executable file (
> >> > ??? different file ) from the MSIL code (Assembly ???)
> >> >
> >> > Am I right? If right please I don't understand what is PE and why it is
> >> > used
> >> > then.
> >> >
> >> >
> >> >
> >> > "Scott Allen" wrote:
> >> >
> >> >> Hi Mahesh:
> >> >>
> >> >> PE is a file format.
> >> >>
> >> >> An assembly is the smallest unit of deployment for .NET applications
> >> >> and consist of one or more modules. These modules use the PE file
> >> >> format.
> >> >>
> >> >> --
> >> >> Scott
> >> >> http://www.OdeToCode.com/blogs/scott/
> >> >>
> >> >> On Sun, 1 May 2005 12:17:05 -0700, suresh_C#
> >> >> <(E-Mail Removed)> wrote:
> >> >>
> >> >> >Dear All,
> >> >> >
> >> >> >What is difference between Portable Executable (PE) file and a Assembly?
> >> >> >
> >> >> >Thanks,
> >> >> >Mahesh
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >>
> >>
> >>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query:What's the difference between executable file and binary file? Jack Dowson Java 5 05-07-2007 08:33 PM
difference between assembly in aspx page and web.config? Beemer Biker ASP .Net 2 04-24-2007 10:55 PM
what is fast dynamically linked executable or statically linked executable ?how to decide? pratap C Programming 20 03-07-2007 04:46 AM
How can I run a c executable in pwd ,while the executable is in some other directory vishsid3@gmail.com C Programming 15 08-21-2006 06:04 AM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM



Advertisments