News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Weird problem with JL / JLE instruction

Started by FlySky, December 26, 2011, 09:42:50 AM

Previous topic - Next topic

FlySky

Hey guys,

I am just playing with large numbers in my program and encountered the following:

When a value is larger than:

10000000h it has to not take the jump. Else take the jump.

The numbers are translated using htodw as the numbers are text-strings.

after htodw converts the string to it's DWORD value I am using:

cmp eax, 10000000h
jle > SkipTheCode

DoMathematicalOperation:

SkipTheCode:
Ret

Now with the following values the JLE is taken while the values are bigger than 10000000h.

804B1D35 --> JLE is taken ??
8C067485 --> JLE is taken ??
895E498B --> JLE is taken ??
DFB9392C --> JLE is taken ??
CF7953D6 --> JLE is taken ??

Is there any reason why this is happening?
I know 32 bit is limited to 7FFFFFFFh, but why does it stick in in EAX than?
So does it has to be translated into an QWORD value?

Merry xmas and thx for helping already!.


jj2007


FORTRANS

Hi,

   JL and JLE are for signed numbers.  The values you posted
are negative, and are less than 10000000H.  Look at JB and JBE
for unsigned comparisons.

HTH,

Steve N.

dedndave

...and JA, JAE

JL, JG, JLE, JGE are for signed comparison

JZ/JE works in both signed and unsigned

what you need is a good table   :bg

http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_6/CH06-5.html#HEADING5-226