Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem in binary compilation with assembly language. Pin
SNI6-Oct-08 20:55
SNI6-Oct-08 20:55 
GeneralRe: Problem in binary compilation with assembly language. Pin
Naveen6-Oct-08 21:06
Naveen6-Oct-08 21:06 
GeneralRe: Problem in binary compilation with assembly language. Pin
SNI6-Oct-08 22:35
SNI6-Oct-08 22:35 
GeneralRe: Problem in binary compilation with assembly language. Pin
Naveen6-Oct-08 22:37
Naveen6-Oct-08 22:37 
GeneralRe: Problem in binary compilation with assembly language. Pin
SNI7-Oct-08 22:52
SNI7-Oct-08 22:52 
GeneralRe: Problem in binary compilation with assembly language. Pin
Naveen7-Oct-08 22:55
Naveen7-Oct-08 22:55 
GeneralRe: Problem in binary compilation with assembly language. Pin
SNI7-Oct-08 23:45
SNI7-Oct-08 23:45 
AnswerRe: Problem in binary compilation with assembly language. Pin
enhzflep5-Oct-08 20:29
enhzflep5-Oct-08 20:29 
I'd expect you'll find the problem to be in the call ecx command.

Basically, this code appears to be designed to call a function that resides in the code segment of your program - I'm more than a little surprised that the address of the function in memory is hard-coded into the function like that - the danger being that the code crashes. Poke tongue | ;-P

All the code is doing is making a single call to a function, then cleaning up the stack afterwards.

__asm {
; push value of ebx onto stack
Push EBX

; set eax to 1
Mov EAX, 1

; push eax(1) onto stack
Push EAX

; push eax(1) onto stack
Push EAX

; set ecx to 0x402EE0
Mov ECX, 0402EE0h

; call the function at 0x402EE0, with the arguments: 1, 1, whatever_was_in_ebx
Call ECX

; adjust the stack pointer - 'undoes' the 3 push instructions - quicker than 3 pop instructions
Add ESP, 0Ch

; save the result of the call to the memory location 14 bytes past what ebx was pointing to
Mov [EBX + 014h], EAX
}

If you were to comment out the last and 3rd last instructions, this code would no longer crash (though something following it will fail to work, of course)
Questionnew ActiveX control leaks memory Pin
followait5-Oct-08 19:27
followait5-Oct-08 19:27 
Question870715 - CListCtrl::OnLvnItemchangedList Pin
ilostmyid25-Oct-08 19:12
professionalilostmyid25-Oct-08 19:12 
AnswerRe: 870715 - CListCtrl::OnLvnItemchangedList Pin
Naveen5-Oct-08 20:15
Naveen5-Oct-08 20:15 
AnswerRe: 870715 - CListCtrl::OnLvnItemchangedList Pin
Michael Dunn5-Oct-08 20:22
sitebuilderMichael Dunn5-Oct-08 20:22 
QuestionInterprocess Comunication Using Events Pin
ForNow5-Oct-08 12:27
ForNow5-Oct-08 12:27 
AnswerRe: Interprocess Comunication Using Events Pin
Bram van Kampen5-Oct-08 15:01
Bram van Kampen5-Oct-08 15:01 
GeneralRe: Interprocess Comunication Using Events Pin
ForNow5-Oct-08 15:15
ForNow5-Oct-08 15:15 
GeneralRe: Interprocess Comunication Using Events Pin
ForNow5-Oct-08 15:31
ForNow5-Oct-08 15:31 
AnswerRe: Interprocess Comunication Using Events Pin
Sarath C5-Oct-08 17:24
Sarath C5-Oct-08 17:24 
GeneralRe: Interprocess Comunication Using Events Pin
ForNow5-Oct-08 17:35
ForNow5-Oct-08 17:35 
GeneralRe: Interprocess Comunication Using Events Pin
Sarath C5-Oct-08 17:41
Sarath C5-Oct-08 17:41 
GeneralRe: Interprocess Comunication Using Events Pin
ForNow5-Oct-08 17:45
ForNow5-Oct-08 17:45 
GeneralRe: Interprocess Comunication Using Events Pin
Sarath C5-Oct-08 17:56
Sarath C5-Oct-08 17:56 
GeneralRe: Interprocess Comunication Using Events Pin
ForNow5-Oct-08 19:20
ForNow5-Oct-08 19:20 
GeneralRe: Interprocess Comunication Using Events Pin
ForNow6-Oct-08 14:34
ForNow6-Oct-08 14:34 
GeneralRe: Interprocess Comunication Using Events Pin
Sarath C6-Oct-08 17:22
Sarath C6-Oct-08 17:22 
GeneralRe: Interprocess Comunication Using Events Pin
ForNow6-Oct-08 19:44
ForNow6-Oct-08 19:44 

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.