Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 12th, 2006, 10:37 PM   #1
rsnd
Hobbyist Programmer
 
rsnd's Avatar
 
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4 rsnd is on a distinguished road
someone help out this newbie

What is this?
lea     ecx, ds:80h[ecx*4]

is it simply ecx = ecx * 4? Does it have anything to do with the data segment?

it appears here:
this::0 = &some_vector_table;
this::8 = 0;

if (unknown_global_1000EA80 == 0 || unknown_global_1000EA84 & 31==0) {
	mov     ecx, unknown_global_1000EA84
	lea     ecx, ds:80h[ecx*4]
	unknown_global_1000EA80 = realloc(unknown_global_1000EA80, ecx);
}

unknown_global_1000EA80[unknown_global_1000EA84] = &this;
unknown_global_1000EA84++;
this::12 = 0;
if (someglobalsocketvariable == 0) {
	some_fdset.fd_count = 0;
	other_fd.fd_count = 0;
}
thanks
__________________
Spread your wings and fly! Chicken!
rsnd is offline   Reply With Quote
Old Aug 13th, 2006, 4:35 AM   #2
Harakim
Hobbyist Programmer
 
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3 Harakim is on a distinguished road
I haven't programmed in x86 assembly for years.

lea is load effective address

lea ecx, ds:80h[ecx*4]

This loads an address into ecx. It doesn't actually load anything from memory. It just calculates the address. I think it basically allows you to use mathmatical operations rather than instructions to make code cleaner.

ds is one of the segmentation registers. It seems like I used ds to access the hard drive. Since you have the word socket in there, it makes me think it could be the network, although I'm speculating now.

Hopefully I helped a little.
Harakim is offline   Reply With Quote
Old Aug 13th, 2006, 1:07 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Using lea is like setting a pointer to point to a variable, rather than fetching the variable. DS is the data segment register. It is not required that one use if strictly for that, more in the nature of a convention.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 14th, 2006, 3:09 AM   #4
rsnd
Hobbyist Programmer
 
rsnd's Avatar
 
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4 rsnd is on a distinguished road
hmm... I dont understand that data segment register bit: "ds:80h." There are a couple of strings declared on 80h offset of data segment and should not be relevent. What is its purpose there? From what I see its calculating the new size of a buffer. From what I remember, my college professor used to use "rAB:rCD:rEF" notation to denote higher resolution numbers.
__________________
Spread your wings and fly! Chicken!
rsnd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help for newbie programmer... techjunkie900 Other Programming Languages 13 Aug 17th, 2005 11:41 AM
Explain Member Status to a Newbie, por favor Wraith Daquell Coder's Corner Lounge 15 May 28th, 2005 12:49 PM
Newbie: How to make simple Timer programe smith000monday Assembly 0 May 17th, 2005 3:54 AM
Newbie : need help with Dev-C++ compiler gemini_shooter C++ 16 Apr 12th, 2005 4:09 AM
Newbie Question: C++ .EXEs. ian C++ 13 Feb 23rd, 2005 12:45 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:18 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC