Why assembly and translation

B

Bob Jenkins

Sorry, I am new to programming, can you tell me why we need to learn
assembly ? What advantages/disadvantages does it have ?

Please answer this, can you tell me if there is any program able to
help me change code in assembly to a figurable level of c/C++ ???

Thanks
 
?

=?ISO-8859-1?Q?Daniel_Sch=FCle?=

Sorry, I am new to programming, can you tell me why we need to learn
assembly ? What advantages/disadvantages does it have ?

you can program C++ without the need to see assembly at all
it depends on what are you doing
if you program microcontroller (more likely in C) then it becames
obviously more important
in general it helps to understand what is going behind the hood
Please answer this, can you tell me if there is any program able to
help me change code in assembly to a figurable level of c/C++ ???

change code of an executable (.exe)?
i am not aware of such tools
why would one need to?

Gruss, Daniel
 
T

Thomas Matthews

Bob said:
Sorry, I am new to programming, can you tell me why we need to learn
assembly ?
Assembly is very useful in debugging programs. Many times
the debugger can't (or won't) display the C++ or C source
code, but can display the assembly language statements.

Another reason is to have finer control over the processor.
Sometimes a function needs to be implemented more efficiently
than the Compiler generated code or to use processor specific
instructions. For example, some Intel processors have
string processing instructions which the compiler may not
take advantage of.

Also, assembly language gives you more understanding of
how the processor works, especially transfering data from
memory to registers and back.
What advantages/disadvantages does it have ?

Please answer this, can you tell me if there is any program able to
help me change code in assembly to a figurable level of c/C++ ???
Yes, there are tools out there. However, there is a very
small chance that the source code will be meaningful. There
are many ways to generate assembly code for the higher level
constructs. The tool cannot know which construct generated
the assembly language.


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 
J

James Aguilar

Bob Jenkins said:
Sorry, I am new to programming, can you tell me why we need to learn
assembly ? What advantages/disadvantages does it have ?

Please answer this, can you tell me if there is any program able to
help me change code in assembly to a figurable level of c/C++ ???

About the assembly: in addition to what others have said, it just straight
up gives you a better understanding of what's going on "under the hood."

- JFA1
 
C

Carl Muller

Sorry, I am new to programming, can you tell me why we need to learn
assembly ? What advantages/disadvantages does it have ?

Please answer this, can you tell me if there is any program able to
help me change code in assembly to a figurable level of c/C++ ???

Thanks

You need to know assembly so that when you find a bug in the compiler,
you can say what it is doing wrong to the compiler vendor :)

Admittedly I don't know of anyone at Microsoft who would be able to do
anything about bugs in their code generation without charging you
an arm and a leg for the privilege (e.g. an issue I noticed
with Visual C++ 6.0 where it got confused between the cl and dl registers)
but some other compiler vendors appreciate you providing a short snippet of
C or C++ code with the generated assembly and the bug highlighted,
and even fix it in the next version :)
Note that nearly all the time bugs are in your code rather than the
compiler, so you have to be very sure of the problem before you send
such a bug report.

Oh yeah, and it can be useful in your code as well, if you put bugs into it
and the bug only shows up in the version that doesn't have source code :-/

Plus the usual stated advantages of performance or extra capabilities when
you are dealing with specialised architectures, although that really depends
on your application field.
 

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
474,202
Messages
2,571,057
Members
47,661
Latest member
sxarexu

Latest Threads

Top