ILASM ?

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi,

why have a tool like ILASM.exe that is generating code just like the CSC.exe
?

what is the added value ?

thnx

Chris
 
Hi,

I know that difference between both tools ...

.... but digging a little deeper you'll notice that they both allow me to
generate a PE-file (assembly) by using completely different input however !

- csc uses C#-code (in text-format) as its input (OK)

- ilasm.exe uses a text-file as well as input (extension .il) but no C#
fomrat anymore (of course) but typical 'assembly' format
You can generate an il-file using ildasm.exe then goto File\Dump :
e.g. myFile.il
this file can then be used as follows : ilasm.exe myfile.il
the result will be myfile.exe --> a valid assembly !!!

but can anybody give me a reason when that tool would be useful ?

thnx

Chris
 
Chris said:
I know that difference between both tools ...

... but digging a little deeper you'll notice that they both allow me
to generate a PE-file (assembly) by using completely different input
however !

- csc uses C#-code (in text-format) as its input (OK)

- ilasm.exe uses a text-file as well as input (extension .il) but no
C# fomrat anymore (of course) but typical 'assembly' format
You can generate an il-file using ildasm.exe then goto File\Dump :
e.g. myFile.il
this file can then be used as follows : ilasm.exe myfile.il
the result will be myfile.exe --> a valid assembly !!!

but can anybody give me a reason when that tool would be useful ?

Maybe I do not understand you, but you compare an assembler-tool with an
c# compiler....
And now you are brining in some disassembler...

What is your goal !?
What is your real question !?
What do you not understand... !?


The same thing is with the old masm and cl-compiler.... (and also some
disassemblers).

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp

Do you need daily reports from your server?
http://sourceforge.net/projects/srvreport/
 
Because you may find it worthwhile to write your code in IL instead of C# ,
VB.NET etc. Writing IL was probably the biggest learning aid in helping me
learn .NET, and while I don't use NotePad and hack out IL professionally,
learning to program IL can really help you as a .NET developer.
 
but can anybody give me a reason when that tool would be useful ?

Example 1: Imagine you had to write a RegExp compiler - a class that takes a
Regular expression and compiles it into IL-code which gets JITed when first
used: a sound understanding of IL would be a great aid, ILASM will be a
great help during development.
(Of course, the same applies to any other compiler you would like to write,
too)

Example 2: There are some (although very very few) things that cannot be
done in C#, but in ILASM, or that can be done more efficiently in ILASM, so
it might sometimes be useful to use IL-Assembler code instead of C# code in
production code.

Example 3: Sometimes it is neccessary to change code without having the
sources (e.g. to remove a bug from an old application where the source code
is no longer available). This is only possible with IL - since executables
cannot be decompiled to C# code.

Just to name a few.

Niki
 
obviously, if you know how to write in MSIL, you can use ILASM to compile it into DLL. it allows you directly write MSIL code without using the higher level languages. it's just another compiler like csc, vbc and any other compiler targets the .NET framework.
 
Chris said:
I know that difference between both tools ...

... but digging a little deeper you'll notice that they both allow me to
generate a PE-file (assembly) by using completely different input however !

Um, yes. Just like a traditional assembler, C compiler, Delphi compiler
etc all produce native code from different inputs.

What's the problem here?
but can anybody give me a reason when that tool would be useful ?

Not many people will have a good use for ilasm, but it's sometimes
handy if you want to know what's going on at the CLR level and play
around with IL directly.
 
Niki Estner said:
Example 3: Sometimes it is neccessary to change code without having the
sources (e.g. to remove a bug from an old application where the source code
is no longer available). This is only possible with IL - since executables
cannot be decompiled to C# code.

Have you not used Reflector?

http://www.aisto.com/roeder/dotnet
 
Chris said:
Hi,

why have a tool like ILASM.exe that is generating code just like the
CSC.exe ?

what is the added value ?

thnx

Chris

Why have a VB.NET compiler or a Delphi for .NEt compiler or a Cobol.NET
compiler or a ..... (you get the picture)

Some people prefer different languages, and assembler is a valid
programming option for some people.

Rgds Tim.
 
Thanks to all.

Tim Jarvis said:
Why have a VB.NET compiler or a Delphi for .NEt compiler or a Cobol.NET
compiler or a ..... (you get the picture)

Some people prefer different languages, and assembler is a valid
programming option for some people.

Rgds Tim.
 
Back
Top