Clan x86

Technical (Development, Security, etc.) => General Programming => Topic started by: MyndFyre on August 25, 2005, 01:48:38 pm

Title: [Resolved] [Asm] OK, I need help
Post by: MyndFyre on August 25, 2005, 01:48:38 pm
Code: [Select]
.text:0058B47E                 push    eax             ; buf
.text:0058B47F                 push    ecx             ; s
.text:0058B480                 call    ds:recv         ; recv pops its own arguments from the stack
.text:0058B486                 mov     ebx, eax
.text:0058B488                 test    ebx, ebx
.text:0058B48A                 mov     [ebp+var_8], ebx
.text:0058B48D                 jge     short loc_58B49E
.text:0058B48F                 call    ds:WSAGetLastError
I don't get this.

Specifically, what I don't get, is this:
Code: [Select]
.text:0058B486                 mov     ebx, eax
.text:0058B488                 test    ebx, ebx
.text:0058B48D                 jge     short loc_58B49E
You're testing ebx against itself.  WOULDN'T IT ALWAYS BE EQUAL?!?

And why does no documentation I find about AND say what flags are set?  Why would AND set the overflow flag?  I mean, seriously?
Title: Re: [Asm] OK, I need help
Post by: MyndFyre on August 25, 2005, 02:30:10 pm
nvm, Skywing explained it to me.  test reg, reg generally indicates a comparison to zero.
Title: Re: [Resolved] [Asm] OK, I need help
Post by: GameSnake on August 25, 2005, 03:20:38 pm
WOULDN'T IT ALWAYS BE EQUAL?!?

And why does no documentation I find about AND say what flags are set?  Why would AND set the overflow flag?  I mean, seriously?
Quote
First time I have seen the mighty english king talk in caps like that. :P

Also why do you capatilize and in the middle of the sentence, to simulate shouting?
Title: Re: [Resolved] [Asm] OK, I need help
Post by: dx on August 25, 2005, 04:11:59 pm
Deemed off topic, and further more suitable for Trash can.
Title: Re: [Asm] OK, I need help
Post by: iago on August 25, 2005, 04:41:31 pm
nvm, Skywing explained it to me.  test reg, reg generally indicates a comparison to zero.

Yeah, testing a reg with itself is a very common way of saying if(reg) { .. }
Title: Re: [Resolved] [Asm] OK, I need help
Post by: rabbit on August 25, 2005, 05:01:01 pm
Quote
WOULDN'T IT ALWAYS BE EQUAL?!?

And why does no documentation I find about AND say what flags are set?  Why would AND set the overflow flag?  I mean, seriously?
First time I have seen the mighty english king talk in caps like that. :P

Also why do you capatilize and in the middle of the sentence, to simulate shouting?
Because "and" is a word junction whereas "AND" is a bitwise operation.
Title: Re: [Resolved] [Asm] OK, I need help
Post by: MyndFyre on August 25, 2005, 07:18:09 pm
Also why do you capatilize and in the middle of the sentence, to simulate shouting?

GJ at farking up the quote, noob.  :P

And yes, if you knew about the topic, the TEST instruction is actually an AND operation that doesn't store the result in a register.  Hence, asking about the AND operation in reference to the TEST instruction was appropriate.

I capitalize assembly mneumonics in regular sentances (such as AND or OR) to distinguish them from normal speech.

And read my signature:
Quote from: MyndFyre
This is for people WHO TYPE IN ALL CAPS ALL THE TIME:
I typed in all caps there, and it was about people who do it "all the time."

GJ.
Title: Re: [Resolved] [Asm] OK, I need help
Post by: GameSnake on August 25, 2005, 10:45:46 pm
Wow if you actually have to call me a name over a little poking-fun then your a dick head, and I don't care if you don't vote for me you have been uptight and rude since I've known you.

Also I figured AND was part of your coding as I did read the sentence, it was also poking fun but hey with you there isn't any fun is there?
Title: Re: [Resolved] [Asm] OK, I need help
Post by: MyndFyre on August 25, 2005, 10:52:42 pm
Wow if you actually have to call me a name over a little poking-fun then your a dick head, and I don't care if you don't vote for me you have been uptight and rude since I've known you.

Also I figured AND was part of your coding as I did read the sentence, it was also poking fun but hey with you there isn't any fun is there?

Apparently I'm not the only one who "missed" "the joke":
Deemed off topic, and further more suitable for Trash can.
Because "and" is a word junction whereas "AND" is a bitwise operation.

I'd also like to point out that there are other people who make asses of themselves and then try to say they were joking.  The first one who comes to mind?  Mangix (http://forum.valhallalegends.com/phpbbs/index.php?topic=12617.msg125417#msg125417).

For the record, it's atypical that I call someone a "noob," and it's generally not meant to be condescending.  I might call Newby or Warrior a noob because I like them.

However, I *am* a dickhead to people I don't like.  Trying to call me out, as you have several times, isn't a good way to get me to like you.  And I'm not saying that you should want me to like you.  However, these were my first two private statements about you:
Pretty funny guy.  He takes shit allright too.
Apparently I was wrong.
Title: Re: [Resolved] [Asm] OK, I need help
Post by: rabbit on August 25, 2005, 11:41:44 pm
It's also kind of a good idea not to piss off the people that need to vote 'Yes' for you ;/
Title: Re: [Resolved] [Asm] OK, I need help
Post by: Newby on August 25, 2005, 11:48:56 pm
He must have missed the ":P" part after "noob." eh? :P
Title: Re: [Resolved] [Asm] OK, I need help
Post by: dx on August 26, 2005, 12:20:42 am
My no still stands.
Title: Re: [Resolved] [Asm] OK, I need help
Post by: Joe on August 26, 2005, 01:02:35 am
*sigh*