Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to resume a thread which was created by _beginthreadex? Pin
kcynic28-Sep-08 3:24
kcynic28-Sep-08 3:24 
QuestionRe: how to resume a thread which was created by _beginthreadex? Pin
CPallini28-Sep-08 4:32
mveCPallini28-Sep-08 4:32 
AnswerRe: how to resume a thread which was created by _beginthreadex? Pin
kcynic28-Sep-08 14:07
kcynic28-Sep-08 14:07 
AnswerRe: how to resume a thread which was created by _beginthreadex? Pin
Mark Salsbery28-Sep-08 10:43
Mark Salsbery28-Sep-08 10:43 
GeneralRe: how to resume a thread which was created by _beginthreadex? Pin
kcynic28-Sep-08 18:09
kcynic28-Sep-08 18:09 
Questiongu and pc command of Windbg Pin
George_George28-Sep-08 1:33
George_George28-Sep-08 1:33 
QuestionHow to change the heights of the rows of a splitter proportional to the size of the windows ! Pin
CrocodileBuck28-Sep-08 0:49
CrocodileBuck28-Sep-08 0:49 
Questionquestion about cin Pin
George_George27-Sep-08 22:40
George_George27-Sep-08 22:40 
Hello everyone,


I posted the source codes related with assembly code for a very simple program below. I have inlined my questions.

Let me repeat my question here,

1. ebp is not used in function main? only esp is used to represent variables on stack?

2. what is the purpose of rdx in statement "lea rdx,[rsp+30h]", store the 2nd parameter to operator <<, which is address of b (address of an integer)?

#include <iostream>

using namespace std;

int foo (int a)
{
	int b;
	cin >> b;
	a = a * b;

	return a;
}

int main()
{
0000000140001000  sub         rsp,28h 
// ebp is not used?
	cout << foo (10);
0000000140001004  mov         rcx,qword ptr [__imp_std::cin (140002080h)] 
000000014000100B  lea         rdx,[rsp+30h] 
// rcx as the 1st parameter for function operator >>
// what is the purpose of rdx here, store the 2nd parameter to operator >>, which is address of b (address of an integer)?
0000000140001010  call        qword ptr [__imp_std::basic_istream<char,std::char_traits<char> >::operator>> (140002078h)] 
0000000140001016  mov         r11d,dword ptr [rsp+30h] 
000000014000101B  mov         rcx,qword ptr [__imp_std::cout (140002090h)] 
0000000140001022  lea         edx,[r11+r11*4] 
0000000140001026  add         edx,edx 
0000000140001028  call        qword ptr [__imp_std::basic_ostream<char,std::char_traits<char> >::operator<< (140002088h)] 
	return 0;
000000014000102E  xor         eax,eax 
}



regards,
George
AnswerRe: question about cin Pin
followait28-Sep-08 3:20
followait28-Sep-08 3:20 
GeneralRe: question about cin Pin
George_George28-Sep-08 3:38
George_George28-Sep-08 3:38 
GeneralRe: question about cin Pin
followait28-Sep-08 4:16
followait28-Sep-08 4:16 
GeneralRe: question about cin Pin
George_George29-Sep-08 23:11
George_George29-Sep-08 23:11 
QuestionHow to determine if a GDI object handle is valid? Pin
followait27-Sep-08 20:10
followait27-Sep-08 20:10 
AnswerRe: How to determine if a GDI object handle is valid? Pin
Gary R. Wheeler28-Sep-08 2:17
Gary R. Wheeler28-Sep-08 2:17 
AnswerRe: How to determine if a GDI object handle is valid? Pin
Michael Dunn28-Sep-08 12:32
sitebuilderMichael Dunn28-Sep-08 12:32 
QuestionSharing DLL data among different process Pin
ForNow27-Sep-08 19:07
ForNow27-Sep-08 19:07 
Questionhow to catch the redraw event of flash control? Pin
61934514227-Sep-08 16:51
61934514227-Sep-08 16:51 
QuestionDialog and Propertypage question? Pin
Rangarajan Varadan27-Sep-08 16:48
Rangarajan Varadan27-Sep-08 16:48 
QuestionWhat is the difference among the OnClose(),OnDestroy() and the DestroyWindow()? Pin
aygrhnwms30427-Sep-08 16:32
aygrhnwms30427-Sep-08 16:32 
QuestionRe: What is the difference among the OnClose(),OnDestroy() and the DestroyWindow()? Pin
David Crow27-Sep-08 16:38
David Crow27-Sep-08 16:38 
AnswerRe: What is the difference among the OnClose(),OnDestroy() and the DestroyWindow()? Pin
aygrhnwms30427-Sep-08 21:02
aygrhnwms30427-Sep-08 21:02 
AnswerRe: What is the difference among the OnClose(),OnDestroy() and the DestroyWindow()? Pin
Ali Tavakol28-Sep-08 4:47
Ali Tavakol28-Sep-08 4:47 
AnswerRe: What is the difference among the OnClose(),OnDestroy() and the DestroyWindow()? Pin
Michael Dunn28-Sep-08 12:34
sitebuilderMichael Dunn28-Sep-08 12:34 
Questionreading text file Pin
nomi khan27-Sep-08 12:55
nomi khan27-Sep-08 12:55 
AnswerRe: reading text file Pin
David Crow27-Sep-08 16:40
David Crow27-Sep-08 16:40 

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.