test eax, eax - why?
- From: spamtrap@xxxxxxxxxx
- Date: 24 Aug 2006 07:41:06 -0700
Hi everyone,
I'm trying to learn x86 assembly language, and in addition to reading
the necessary books, trying the programmes etc., I'm also compiling my
own example C code and comparing it with the resultant (Visual C++)
code.
One thing I tried was compiling the "infinite" while(1){ ... } loop. I
got something like this:
mov eax, 1
test eax, eax
je label2
this seems somewhat odd. I know that "test" does a bitwise and of eax
and eax, but in this case, the rest of the
instruction (je) is not carried out. Why bother with this at all? Or
have I got the wrong end of the stick?
TIA
Paul
.
- Follow-Ups:
- Re: test eax, eax - why?
- From: randyhyde@xxxxxxxxxxxxx
- Re: test eax, eax - why?
- From: Jack Klein
- Re: test eax, eax - why?
- Prev by Date: Re: I feel stupid... "Invalid combination of opcode and operand", was, now is FORTH question
- Next by Date: Re: I feel stupid... "Invalid combination of opcode and operand"
- Previous by thread: Is there any forum for [BIOS] ?
- Next by thread: Re: test eax, eax - why?
- Index(es):
Relevant Pages
|