By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 981 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

Why assembly and translation

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
> 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
Jul 23 '05 #2

P: n/a
Bob Jenkins wrote:
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.

Thanks

--
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
Jul 23 '05 #3

P: n/a
"Bob Jenkins" <gi*****@lycos.com> wrote in message
news:9c**************************@posting.google.c om...
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
Jul 23 '05 #4

P: n/a
gi*****@lycos.com (Bob Jenkins) wrote in message news:<9c**************************@posting.google. com>...
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.
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.