Anyway from your code there is absolutly
no way to predict what could be in eax after all
THE SVIN

I dont know what ur problem is, u wont me to wriete whole code (i do not have NET so my questions are shorter that they should be, but i was counting on ur IQ) ??????

xor eax,eax
xor ebx,ebx

here is the part of missing part :P

bdw thx to u all but i have got another question

Can change values of flags for example CF by myself ?
Posted on 2002-12-02 04:09:11 by drakoforma

I dont know what ur problem is, u wont me to wriete whole code (i do not have NET so my questions are shorter that they should be, but i was counting on ur IQ) ??????

xor eax,eax
xor ebx,ebx

here is the part of missing part :P

bdw thx to u all but i have got another question

Can change values of flags for example CF by myself ?

My IQ is very low.
I'm wellknown here as the dumbest coder on the board.

To change CF and keep unchanged the rest of the flags:

1.set carry to 1
- STC
+ more other ways
2. set carry to 0
- CLC
+ more other ways
3. invert carry
- CMC
+ lots more other ways
4. To know more about all this ways and other flags affectation.
Posted on 2002-12-02 05:19:58 by The Svin
:grin:

THX mr. wellknown :alright:
Posted on 2002-12-03 04:19:42 by drakoforma
Sorry for digging this old thread, an idea just came to me. Yay!, :grin: I have another solution...
``````mov     ecx, eax        ;ecx == eax
neg     eax             ;if eax is sign then eax = 0 - (-eax) -> positive
;if eax is not sign then eax = 0 - eax -> negative
cmovs   eax, ecx        ;if eax is sign then copy ecx
;if eax is not sign don't copy anything``````
of course, CMOVcc instruction is only supported on P6/PPro++ and other x86 processors but not all .... :)

this for abolute values. :)
Posted on 2002-12-06 16:13:22 by stryker
simulating movsx...
``````mov     cl, -128
mov     al, cl
shl     eax, 24
sar     eax, 24``````
Useless but an alternative. :)

simulating movsx for 16 bit size. :)
``````mov     cx, -32768
mov     ax, cx
shl     eax, 16
sar     eax, 16``````
Posted on 2002-12-06 17:15:39 by stryker
Smaller:

mov al, cl
cbw
cwd

16-bit:
mov ax, cx
cwd
Posted on 2002-12-09 02:01:27 by gliptic