Thread: Counting machine code?

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    5

    Question Counting machine code?

    Is there a way or a way to find out how many machine code instructions are being executed when you run your program? I've tried stepping through the assembly code but there are too many to count by hand. I'm using Visual C++ 6.0.

    Thanks for your help.

  2. #2
    Unregistered
    Guest
    I don't know, but why would you want to do that?

  3. #3
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    try disassembling it. lots of asm code there
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    5
    I tried to disassemble but there are too many calls to other subroutines to count all the asm code. I was looking for an easier way to do that.

  5. #5
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    you can get some idea from the size of the finished executable.
    Some profilers may offer an option to count instructions. All will give you some idea of the time spent in each function.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  6. #6
    Registered User
    Join Date
    Feb 2002
    Posts
    5
    I'm having trouble using Visual C++ 6.0 enterprise edition's profiler. I enabled profiling under the project settings and I built my project. But when I try to choose profile under the build menu it's dimmed out. Any ideas what I'm doing wrong?

    Thanks

  7. #7
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    go into the command prompt:

    type
    >debug

    then type
    >U

    and then press R to view the first instruction and keep pressing T to see the next until you reach the end.

    I think so anyway...

  8. #8
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    >But when I try to choose profile under the build menu it's dimmed out. Any ideas what I'm doing wrong?

    Have you tried here.

  9. #9
    Registered User
    Join Date
    Feb 2002
    Posts
    5
    Thanks, that worked.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  2. machine learning code in c/c++
    By nchauhan in forum Game Programming
    Replies: 0
    Last Post: 11-14-2003, 10:26 AM
  3. The relationship between C++ and assembly and machine code
    By TotalBeginner in forum C++ Programming
    Replies: 5
    Last Post: 04-22-2002, 02:46 PM
  4. Machine code, asm, poop
    By tim545666 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 04-02-2002, 01:27 AM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM