News:

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

Is it only for unsigned value??

Started by Farabi, September 13, 2008, 05:22:55 AM

Previous topic - Next topic

Farabi

Im using cmp and ja mnemonic where the source is a negative value. But why it doesnot jump??
Quote
cmp hmnpos.x,-10 ; when the hmnpos.x value is -10 or less it doesnot jump
jnz no_change2 ;
push 320
pop hmnpos.x
push 1
pop sign
jmp quit_selection
no_change2:
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

BlackVortex

I think you should use "jg", which is for signed numbers.

Farabi

Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

jj2007

Quote from: Farabi on September 13, 2008, 05:22:55 AM
Im using cmp and ja mnemonic where the source is a negative value. But why it doesnot jump??
Quote
cmp hmnpos.x,-10 ; when the hmnpos.x value is -10 or less it doesnot jump
jnz no_change2 ;

You are testing for zero, which should work for signed and unsigned values. I suggest you add
mov eax, hmnpos.x
cmp hmnpos.x,-10

and see in Olly what the values are.

ToutEnMasm

Hello,
masm do that without problem,let it do it.

1) hmnpos.x must be a sdword ,see the structure hmnpos
2) code it with the masm macro
Quote
.if hmnpos.x == -10
         .
         .
.else
         .
         .
.endif
If you want disassemble the code to see how it's coded.