flat assembler
Message board for the users of flat assembler.
Index
> Windows > VisualC++ ASM |
Author |
|
FrozenKnight 19 Jan 2006, 10:57
Basically it initilizes all local variables used by the current function with the value 0CCCCCCCCh this is really pointless because you will most likely initilize the function anyway. my opinion is that it's a waste of processor time. but it is a good example of how to quickly fill a section of memory with a certan value.
|
|||
19 Jan 2006, 10:57 |
|
RedGhost 20 Jan 2006, 02:19
not really to do with VC++, but for disassembling most C
mov eax, # or xor eax, eax etc then mov edi, address rep stos dword ptr [edi]/ES:[EDI] is usually a call to memset _________________ redghost.ca |
|||
20 Jan 2006, 02:19 |
|
r22 21 Jan 2006, 04:52
That code only shows up in DEBUG builds of vc++ software,
BUILD | CONFIG | Release option, will build a more optimized executable without the debugging stuff like mov eax,0CCCCCCCCh. |
|||
21 Jan 2006, 04:52 |
|
Reverend 21 Jan 2006, 11:19
0CCh is int 3 opcode and it is put there, because if the program has some bug and if the excution flow jumps somewhere illegal the program will crash, and then it shows you all the registers' contents, stack, etc.
|
|||
21 Jan 2006, 11:19 |
|
revolution 21 Jan 2006, 16:00
Often this memory filling also helps when debugging to see what memory is used during the program run time. You can optimise the stack allocation better when you know the expected maximum usage by seeing where the '0xcccccccc' values have been overwritten with code or data used during a test run.
|
|||
21 Jan 2006, 16:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.