Click here to Skip to main content
15,889,034 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General? about wav files Pin
tom_dx1-Nov-04 13:42
tom_dx1-Nov-04 13:42 
GeneralRe: ? about wav files Pin
KRowe1-Nov-04 16:56
KRowe1-Nov-04 16:56 
GeneralGetting the size of a block of code Pin
Xzyx987X1-Nov-04 12:34
Xzyx987X1-Nov-04 12:34 
GeneralRe: Getting the size of a block of code Pin
Andrew Walker1-Nov-04 15:21
Andrew Walker1-Nov-04 15:21 
GeneralRe: Getting the size of a block of code Pin
Xzyx987X1-Nov-04 21:44
Xzyx987X1-Nov-04 21:44 
GeneralRe: Getting the size of a block of code Pin
jan larsen2-Nov-04 0:57
jan larsen2-Nov-04 0:57 
GeneralRe: Getting the size of a block of code Pin
Maximilien2-Nov-04 2:47
Maximilien2-Nov-04 2:47 
GeneralRe: Getting the size of a block of code Pin
jan larsen2-Nov-04 3:29
jan larsen2-Nov-04 3:29 
I think he actually wants to get the op code size of eg.

<code>
void foo()
{
   char buffer[] = "A";
   printf("%s\r\n", buffer);
}
</code>

Which translates to something like:

<code>

<br><br>

section .data

   <span style="color: green">; data aligned on a 4 byte boundary.</span>
   buffer    db 'A', 0, 0, 0          
   mxyzptlk  db "%s\r\n", 0, 0, 0, 0

section .text

_foo:
   <span style="color: green">; Storing general registers for good measure.</span>
   pushaw

   <span style="color: green">; pushing arguments from right to left.</span>
   push dword buffer
   push dword mxyzptlk
   <br>

   <span style="color: green">; calling the extern function.</span>
   call _printf
   <br>

   <span style="color: green">; Cleaning up the stack</span>
   add esp, 8
   <br>

</code>

which again translates to some mumbo jumbo machinecode


But besides the point that it's very hard to see the value in that information, there is the problem of buffer, and the anonymous string "%s\r\n", being declared in a data segment, and the rest of the code goes in a code segment (well, generally anyway, but the rare exceptions really shouldn't count).

"After all it's just text at the end of the day. - Colin Davies

"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
GeneralRe: Getting the size of a block of code Pin
Anonymous2-Nov-04 7:49
Anonymous2-Nov-04 7:49 
GeneralThreading problem Pin
User 9148331-Nov-04 11:35
User 9148331-Nov-04 11:35 
GeneralRe: Threading problem Pin
Blake Miller2-Nov-04 7:59
Blake Miller2-Nov-04 7:59 
GeneralSplitter inside a Tab Window Pin
Ali Niaz1-Nov-04 11:17
Ali Niaz1-Nov-04 11:17 
GeneralRe: Splitter inside a Tab Window Pin
Selvam R2-Nov-04 3:01
professionalSelvam R2-Nov-04 3:01 
GeneralRe: Splitter inside a Tab Window Pin
Selvam R2-Nov-04 3:01
professionalSelvam R2-Nov-04 3:01 
GeneralRe: Splitter inside a Tab Window Pin
Ali Niaz2-Nov-04 4:17
Ali Niaz2-Nov-04 4:17 
QuestionWhere should I automatically launch a Modeless Dialog? Pin
nonothing1-Nov-04 9:51
nonothing1-Nov-04 9:51 
AnswerRe: Where should I automatically launch a Modeless Dialog? Pin
Christian Graus1-Nov-04 10:01
protectorChristian Graus1-Nov-04 10:01 
General.NET C++ MDI App release/debug discrepancy Pin
Jnewg51-Nov-04 9:19
Jnewg51-Nov-04 9:19 
Generalhelp plz Xp dialup Recovery Pin
Member 14861831-Nov-04 9:05
Member 14861831-Nov-04 9:05 
GeneralRe: help plz Xp dialup Recovery Pin
Member 14861832-Nov-04 7:36
Member 14861832-Nov-04 7:36 
GeneralRe: help plz Xp dialup Recovery Pin
ThatsAlok3-Nov-04 18:10
ThatsAlok3-Nov-04 18:10 
Generalcheck if a file exists Pin
hyling1-Nov-04 7:55
hyling1-Nov-04 7:55 
GeneralRe: check if a file exists Pin
Michael Dunn1-Nov-04 8:10
sitebuilderMichael Dunn1-Nov-04 8:10 
GeneralRe: check if a file exists Pin
hyling1-Nov-04 10:19
hyling1-Nov-04 10:19 
GeneralRe: check if a file exists Pin
David Crow1-Nov-04 8:14
David Crow1-Nov-04 8:14 

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.