DWORD PTR [modified]
-
HI all, I have assembly generated code of an simple program C++ code:
int main(int argc, char* argv[])
{
int i =10;
int j =20;
int k = i+j;return 0;
}
some assembly code generated of out it is:
PUBLIC _main
; COMDAT _main
_TEXT SEGMENT
_i$ = -4
_j$ = -8
_k$ = -12
_main PROC NEAR ; COMDAT; 8 : {
push ebp mov ebp, esp sub esp, 76 ; 0000004cH push ebx push esi push edi lea edi, DWORD PTR \[ebp-76\] mov ecx, 19 ; 00000013H mov eax, -858993460 ; ccccccccH rep stosd
; 9 : int i =10;
mov DWORD PTR \_i$\[ebp\], 10 ; 0000000aH
; 10 : int j =20;
mov DWORD PTR \_j$\[ebp\], 20 ; 00000014H
; 11 : int k = i+j;
mov eax, DWORD PTR \_i$\[ebp\] add eax, DWORD PTR \_j$\[ebp\] mov DWORD PTR \_k$\[ebp\], eax
; 12 :
; 13 : return 0;xor eax, eax
; 14 : }
My question is: What is DWORD PTR syntax is in following line
lea edi, DWORD PTR [ebp-76]
modified on Friday, August 8, 2008 5:46 AM
-
HI all, I have assembly generated code of an simple program C++ code:
int main(int argc, char* argv[])
{
int i =10;
int j =20;
int k = i+j;return 0;
}
some assembly code generated of out it is:
PUBLIC _main
; COMDAT _main
_TEXT SEGMENT
_i$ = -4
_j$ = -8
_k$ = -12
_main PROC NEAR ; COMDAT; 8 : {
push ebp mov ebp, esp sub esp, 76 ; 0000004cH push ebx push esi push edi lea edi, DWORD PTR \[ebp-76\] mov ecx, 19 ; 00000013H mov eax, -858993460 ; ccccccccH rep stosd
; 9 : int i =10;
mov DWORD PTR \_i$\[ebp\], 10 ; 0000000aH
; 10 : int j =20;
mov DWORD PTR \_j$\[ebp\], 20 ; 00000014H
; 11 : int k = i+j;
mov eax, DWORD PTR \_i$\[ebp\] add eax, DWORD PTR \_j$\[ebp\] mov DWORD PTR \_k$\[ebp\], eax
; 12 :
; 13 : return 0;xor eax, eax
; 14 : }
My question is: What is DWORD PTR syntax is in following line
lea edi, DWORD PTR [ebp-76]
modified on Friday, August 8, 2008 5:46 AM
-
HI all, I have assembly generated code of an simple program C++ code:
int main(int argc, char* argv[])
{
int i =10;
int j =20;
int k = i+j;return 0;
}
some assembly code generated of out it is:
PUBLIC _main
; COMDAT _main
_TEXT SEGMENT
_i$ = -4
_j$ = -8
_k$ = -12
_main PROC NEAR ; COMDAT; 8 : {
push ebp mov ebp, esp sub esp, 76 ; 0000004cH push ebx push esi push edi lea edi, DWORD PTR \[ebp-76\] mov ecx, 19 ; 00000013H mov eax, -858993460 ; ccccccccH rep stosd
; 9 : int i =10;
mov DWORD PTR \_i$\[ebp\], 10 ; 0000000aH
; 10 : int j =20;
mov DWORD PTR \_j$\[ebp\], 20 ; 00000014H
; 11 : int k = i+j;
mov eax, DWORD PTR \_i$\[ebp\] add eax, DWORD PTR \_j$\[ebp\] mov DWORD PTR \_k$\[ebp\], eax
; 12 :
; 13 : return 0;xor eax, eax
; 14 : }
My question is: What is DWORD PTR syntax is in following line
lea edi, DWORD PTR [ebp-76]
modified on Friday, August 8, 2008 5:46 AM
Vikrams, you've been asking here for long now. when will you format your questions and make use of the
<pre></pre>
tags correctly ?[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
Vikrams, you've been asking here for long now. when will you format your questions and make use of the
<pre></pre>
tags correctly ?[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
Thanks for the guideline.
-
Thanks for the guideline.
:doh: dude, didn't I mention the
<pre></pre>
tags, and not the<code></code>
one ? BTW, thanks for the effort, but please edit once again... thanks. it looks better now...[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
modified on Friday, August 8, 2008 5:54 AM
-
HI all, I have assembly generated code of an simple program C++ code:
int main(int argc, char* argv[])
{
int i =10;
int j =20;
int k = i+j;return 0;
}
some assembly code generated of out it is:
PUBLIC _main
; COMDAT _main
_TEXT SEGMENT
_i$ = -4
_j$ = -8
_k$ = -12
_main PROC NEAR ; COMDAT; 8 : {
push ebp mov ebp, esp sub esp, 76 ; 0000004cH push ebx push esi push edi lea edi, DWORD PTR \[ebp-76\] mov ecx, 19 ; 00000013H mov eax, -858993460 ; ccccccccH rep stosd
; 9 : int i =10;
mov DWORD PTR \_i$\[ebp\], 10 ; 0000000aH
; 10 : int j =20;
mov DWORD PTR \_j$\[ebp\], 20 ; 00000014H
; 11 : int k = i+j;
mov eax, DWORD PTR \_i$\[ebp\] add eax, DWORD PTR \_j$\[ebp\] mov DWORD PTR \_k$\[ebp\], eax
; 12 :
; 13 : return 0;xor eax, eax
; 14 : }
My question is: What is DWORD PTR syntax is in following line
lea edi, DWORD PTR [ebp-76]
modified on Friday, August 8, 2008 5:46 AM
There are different machine code instructions for accessing memory depending on what size the data pointed to is. DWORD means a double-word (4 bytes), and a DWORD PTR indicates a pointer to a double word.
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
HI all, I have assembly generated code of an simple program C++ code:
int main(int argc, char* argv[])
{
int i =10;
int j =20;
int k = i+j;return 0;
}
some assembly code generated of out it is:
PUBLIC _main
; COMDAT _main
_TEXT SEGMENT
_i$ = -4
_j$ = -8
_k$ = -12
_main PROC NEAR ; COMDAT; 8 : {
push ebp mov ebp, esp sub esp, 76 ; 0000004cH push ebx push esi push edi lea edi, DWORD PTR \[ebp-76\] mov ecx, 19 ; 00000013H mov eax, -858993460 ; ccccccccH rep stosd
; 9 : int i =10;
mov DWORD PTR \_i$\[ebp\], 10 ; 0000000aH
; 10 : int j =20;
mov DWORD PTR \_j$\[ebp\], 20 ; 00000014H
; 11 : int k = i+j;
mov eax, DWORD PTR \_i$\[ebp\] add eax, DWORD PTR \_j$\[ebp\] mov DWORD PTR \_k$\[ebp\], eax
; 12 :
; 13 : return 0;xor eax, eax
; 14 : }
My question is: What is DWORD PTR syntax is in following line
lea edi, DWORD PTR [ebp-76]
modified on Friday, August 8, 2008 5:46 AM
DWOD defines the bit size of the memory being used, PTR is a modifier indicating that we are pointing to a memory location. The following are defined in x86
BYTE - 8 bits WORD - 16 bits DWORD - 32 bits ( double word ) QWORD - 64 bits ( quadruple word ) DQWORD - 128 bits ( double quadruple word )
-
DWOD defines the bit size of the memory being used, PTR is a modifier indicating that we are pointing to a memory location. The following are defined in x86
BYTE - 8 bits WORD - 16 bits DWORD - 32 bits ( double word ) QWORD - 64 bits ( quadruple word ) DQWORD - 128 bits ( double quadruple word )
Thank a lot all, for your valuable postings.