Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: API constants value Pin
David Crow2-Dec-04 4:11
David Crow2-Dec-04 4:11 
GeneralRe: API constants value Pin
david_gilmour2-Dec-04 22:15
david_gilmour2-Dec-04 22:15 
GeneralRe: API constants value Pin
David Crow3-Dec-04 2:47
David Crow3-Dec-04 2:47 
Generalviewing my program's assembly code Pin
BlackDice2-Dec-04 2:42
BlackDice2-Dec-04 2:42 
GeneralRe: viewing my program's assembly code Pin
David Crow2-Dec-04 3:58
David Crow2-Dec-04 3:58 
GeneralRe: viewing my program's assembly code Pin
BlackDice2-Dec-04 4:49
BlackDice2-Dec-04 4:49 
GeneralRe: viewing my program's assembly code Pin
David Crow2-Dec-04 5:27
David Crow2-Dec-04 5:27 
GeneralRe: viewing my program's assembly code Pin
BlackDice2-Dec-04 5:39
BlackDice2-Dec-04 5:39 
I already understand that (not that I usually do Smile | :) ) Just in case you didn't know, I am the programmer formerly known as 'bdiamond'. Anyway, I was talking about for other operations that I might not be familiar with. I wrote in another forum once (please CPians forgive me) that using the '+=' operator was faster with CStrings because I read that in a game programming book. One of the forums moderators told me there was no difference. So I put a breakpoint in my code (release version) in an arbitrary function that I used just to test this by going to debug->windows->disassembly and went back throught the disassembly, and this is what I got for two CStrings that started off as "test" and then had "add" concatenated to them.

str += "add";004015BC  push        offset string "add" (4037D0h) <br />
004015C1  lea         ecx,[esp+8] <br />
004015C5  call        dword ptr [__imp_ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > >::operator+= (4031DCh)] <br />
<br />
str2 = str2 + "add";<br />
004015CB  push        offset string "add" (4037D0h) <br />
004015D0  lea         eax,[esp+4] <br />
004015D4  push        eax  <br />
004015D5  lea         ecx,[esp+10h] <br />
004015D9  push        ecx  <br />
004015DA  call        ATL::operator+ (4011C0h) <br />
004015DF  add         esp,0Ch <br />
004015E2  push        eax  <br />
004015E3  lea         ecx,[esp+4] <br />
004015E7  mov         byte ptr [esp+18h],2 <br />
004015EC  call        dword ptr [__imp_ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > >::operator= (4031D8h)] <br />
004015F2  lea         ecx,[esp+8] <br />
004015F6  call        dword ptr [__imp_ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > >::~CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > (403188h)] 


int i = 2, x = 2;

int j = x + y;

sprintf("%d",j);

4.7388937 ???


My articles

www.stillwaterexpress.com

BlackDice
GeneralRe: viewing my program's assembly code Pin
David Crow2-Dec-04 5:56
David Crow2-Dec-04 5:56 
QuestionInline assembly - what good is it? Pin
BlackDice2-Dec-04 2:37
BlackDice2-Dec-04 2:37 
AnswerRe: Inline assembly - what good is it? Pin
geo_m2-Dec-04 4:29
geo_m2-Dec-04 4:29 
GeneralRe: Inline assembly - what good is it? Pin
BlackDice2-Dec-04 4:51
BlackDice2-Dec-04 4:51 
AnswerRe: Inline assembly - what good is it? Pin
John R. Shaw2-Dec-04 4:52
John R. Shaw2-Dec-04 4:52 
GeneralRe: Inline assembly - what good is it? Pin
BlackDice2-Dec-04 4:57
BlackDice2-Dec-04 4:57 
AnswerRe: Inline assembly - what good is it? Pin
Henry miller2-Dec-04 9:07
Henry miller2-Dec-04 9:07 
GeneralRe: Inline assembly - what good is it? Pin
BlackDice2-Dec-04 10:46
BlackDice2-Dec-04 10:46 
AnswerRe: Inline assembly - what good is it? Pin
Harold Bamford3-Dec-04 6:06
Harold Bamford3-Dec-04 6:06 
AnswerRe: Inline assembly - what good is it? Pin
Harold Bamford3-Dec-04 6:20
Harold Bamford3-Dec-04 6:20 
GeneralAPI constants value Pin
wk_vigorous2-Dec-04 2:18
wk_vigorous2-Dec-04 2:18 
GeneralRe: API constants value Pin
BlackDice2-Dec-04 2:33
BlackDice2-Dec-04 2:33 
Questionhide one property page?? Pin
includeh102-Dec-04 2:11
includeh102-Dec-04 2:11 
AnswerRe: hide one property page?? Pin
JoramW2-Dec-04 2:49
JoramW2-Dec-04 2:49 
GeneralRe: hide one property page?? Pin
includeh102-Dec-04 5:02
includeh102-Dec-04 5:02 
GeneralRe: hide one property page?? Pin
JoramW2-Dec-04 22:52
JoramW2-Dec-04 22:52 
Questionhow to know Service pack of MSVC6.0 Pin
Abhi Lahare2-Dec-04 1:58
Abhi Lahare2-Dec-04 1:58 

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.