![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4
![]() |
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;
}
__________________
Spread your wings and fly! Chicken! |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3
![]() |
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. |
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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 |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4
![]() |
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! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help for newbie programmer... | techjunkie900 | Other Programming Languages | 13 | Aug 17th, 2005 10:41 AM |
| Explain Member Status to a Newbie, por favor | Wraith Daquell | Coder's Corner Lounge | 15 | May 28th, 2005 11:49 AM |
| Newbie: How to make simple Timer programe | smith000monday | Assembly | 0 | May 17th, 2005 2:54 AM |
| Newbie : need help with Dev-C++ compiler | gemini_shooter | C++ | 16 | Apr 12th, 2005 3:09 AM |
| Newbie Question: C++ .EXEs. | ian | C++ | 13 | Feb 23rd, 2005 11:45 AM |