Click here to Skip to main content
15,906,181 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help me: need strategy for CrashLogs Pin
Peter Molnar16-Nov-03 2:34
Peter Molnar16-Nov-03 2:34 
GeneralRe: Help me: need strategy for CrashLogs Pin
Ceri16-Nov-03 22:44
Ceri16-Nov-03 22:44 
GeneralRe: Help me: need strategy for CrashLogs Pin
Peter Weyzen17-Nov-03 8:30
Peter Weyzen17-Nov-03 8:30 
GeneralHelp in assembler. Pin
Snyp15-Nov-03 15:10
Snyp15-Nov-03 15:10 
GeneralRe: Help in assembler. Pin
Tim Smith15-Nov-03 16:21
Tim Smith15-Nov-03 16:21 
GeneralRe: Help in assembler. Pin
Snyp15-Nov-03 16:42
Snyp15-Nov-03 16:42 
GeneralRe: Help in assembler. Pin
Joe Woodbury15-Nov-03 18:45
professionalJoe Woodbury15-Nov-03 18:45 
GeneralRe: Help in assembler. Pin
Chris Richardson15-Nov-03 23:49
Chris Richardson15-Nov-03 23:49 
Well, doing the looping in assembler isn't that hard, and here's a tip: to see how to do new things in assembler, just write what you want in C++, run it in the debugger with a breakpoint on the first line, right-click and select "View Disassembly". Then you can see what the compiler does. But anyways, here's how to do a basic loop in inline assembler (x86):

int main( int argc, char * argv[] )
{
   // C++ code would be:
   /*
   int i = 0;
   int j = 0;
   for( i = 0; i < 5; ++i )
   {
      j *= 2;
   }
   */
   int i = 0;
   int j = 1;
   __asm
   {
      // for( int i = 0;
      mov i, 0
      loopstart:
 
      // i < 5;
      cmp i, 5
      jge loopend
      
      // Inside the loop.
      // j *= 2
      mov eax, [dword ptr j]
      imul eax, 2
      mov [dword ptr j], eax
 
      // ++i )
      inc i
     
      // Go back to the beginning now.
      jmp loopstart
      
      // End of loop.
      loopend:
   }
   return 0;
}


Anyways, the other guys are probably right. Don't try to optimize what you don't need to, but if you are just curious about assmebly, then by all means keep learning. Smile | :) I just wanted to actually answer your question.

Chris Richardson
GeneralRe: Help in assembler. Pin
Snyp16-Nov-03 7:50
Snyp16-Nov-03 7:50 
GeneralRe: Help in assembler. Pin
Christian Graus16-Nov-03 16:19
protectorChristian Graus16-Nov-03 16:19 
QuestionHow do startup programs work. Pin
Snyp15-Nov-03 13:56
Snyp15-Nov-03 13:56 
AnswerRe: How do startup programs work. Pin
Antti Keskinen15-Nov-03 14:20
Antti Keskinen15-Nov-03 14:20 
GeneralRe: How do startup programs work. Pin
Snyp15-Nov-03 14:23
Snyp15-Nov-03 14:23 
GeneralRe: How do startup programs work. Pin
Antti Keskinen15-Nov-03 14:39
Antti Keskinen15-Nov-03 14:39 
QuestionGet the first sector of harkdisk in vc++ ? Pin
kendao15-Nov-03 13:38
kendao15-Nov-03 13:38 
AnswerRe: Get the first sector of harkdisk in vc++ ? Pin
Michael Gunlock16-Nov-03 5:54
Michael Gunlock16-Nov-03 5:54 
Questioncreate 100 button in dialog with code ? Pin
kendao15-Nov-03 13:34
kendao15-Nov-03 13:34 
AnswerRe: create 100 button in dialog with code ? Pin
Snyp15-Nov-03 14:23
Snyp15-Nov-03 14:23 
AnswerRe: create 100 button in dialog with code ? Pin
Antti Keskinen15-Nov-03 14:34
Antti Keskinen15-Nov-03 14:34 
GeneralC++ Question. Pin
WREY15-Nov-03 12:39
WREY15-Nov-03 12:39 
GeneralRe: C++ Question. Pin
Antti Keskinen15-Nov-03 14:50
Antti Keskinen15-Nov-03 14:50 
GeneralRe: C++ Question. Pin
WREY15-Nov-03 16:22
WREY15-Nov-03 16:22 
GeneralRe: C++ Question. Pin
Michael Dunn15-Nov-03 16:37
sitebuilderMichael Dunn15-Nov-03 16:37 
GeneralRe: C++ Question. Pin
WREY15-Nov-03 17:49
WREY15-Nov-03 17:49 
GeneralRe: C++ Question. Pin
Peter Weyzen15-Nov-03 18:26
Peter Weyzen15-Nov-03 18:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.