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

What does a class in C++ look like in assembly?

P: 30
If I defined a class in C++

class SomeClass
{
...
}

what would that look in assembly.
Sep 25 '10 #1

✓ answered by TamusJRoyce

C++ usually uses a two stage compiling process. One process compiles it into assembly, and then you can compile that file into a static library.

g++ -c hello.C
g++ hello.o -o hello

This is gnu MinGW (Windows)/gcc (Linux) solution.

If you are to view the hello.o, you can view the assembly.

Searching google or similar search engines for "microsoft visual studio c++ show assembly" has several hits on showing assembly and using assembly in your c++ code for visual studio.

If you are interested in assembly, try some masm and nasm tutorials.

Share this Question
Share on Google+
4 Replies


weaknessforcats
Expert Mod 5K+
P: 9,197
You might compile the code and look at the assembly that was generated.

I don't expect any assembly from a class declaration. It's only when you actually create an object that code is generated.
Sep 26 '10 #2

P: 30
How would I look at the assembly code if my compiler doesnt output readable any assembly code?
Sep 26 '10 #3

weaknessforcats
Expert Mod 5K+
P: 9,197
What product are you using?

Most IDE have a project setting to show generated code underneath the line of C/C++ code.
Sep 26 '10 #4

100+
P: 110
C++ usually uses a two stage compiling process. One process compiles it into assembly, and then you can compile that file into a static library.

g++ -c hello.C
g++ hello.o -o hello

This is gnu MinGW (Windows)/gcc (Linux) solution.

If you are to view the hello.o, you can view the assembly.

Searching google or similar search engines for "microsoft visual studio c++ show assembly" has several hits on showing assembly and using assembly in your c++ code for visual studio.

If you are interested in assembly, try some masm and nasm tutorials.
Sep 26 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.