Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

assembly to c++

Status
Not open for further replies.

danielassembly

Programmer
Mar 13, 2005
4
US
Is there a way to open my plugin/dll and convert it to c++ code?

Daniel
 
No. If you understand assembly language, you can convert your program to the asm instructions and then make a reasonable attempt at writing things in a higher level language.

Lee
 
As far as learning languages go, which is more complex, C++ or assembly?

Daniel
 
It takes a lot more writing and figuring out what you want to write with assembly language than with C++. The purpose of the higher level languages is to allow you to think more in human terms, more abstractly, rather than working with registers and memory addresses directly. I can write things with C++ in hours that would take me a solid week, at least, to figure out how to do with assembly language. And my C++ compiler checks my spelling of functions before generating the machine language for me, so it's a lot harder to make a mistake, and easier to track down the ones I do make.

I use assembly language when I want to optimize something that takes a lot of processing time and the compiler just isn't making it as fast as I want. Other than that, I use higher level languages for the majority of the programming I do.

Lee
 
I use assembly language when I want to optimize something that takes a lot of processing time and the compiler just isn't making it as fast as I want."

This is very interesting. Can you give me a simple example how you can do this? Just so I can get an idea.

Daniel
 
For some good examples of optimizing code, I recommend Code Complete, from Microsoft Press (which is an excellent book overall anyway). Processing large arrays in a loop is a good example of where things can often be speeded up with assembly language. Any time where the user waits for more than a few seconds for the computer to finish whatever work it's doing is somewhere that would probably benefit from either code optimization in the HLL, or converting to assembly language. You have to weigh the time spent converting to ASM and debugging with the amount of time you'll actually save, too.

If you were doing encryption, the code there would probably benefit from conversion to assembly language, especially working with large or multiple files. Sorting arrays is another good candidate for conversion.

Lee
 
Hi trollacious,
Thank you for your response. I will look into that book.

Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top