Hi
I have a question to ja register (Jump if above)
Is this in the high level syntax
;cmp eax,ebx
;ja @return
.if eax>=ebx
Is this correct?
Greets,
These are two examples. Check the attachment for a more complete list (opens in WordPad, MS Word or RichMasm).
Quote.if eax>=0
nop
.endif
test eax, eax
jb @F
nop
@@:
.if sdword ptr eax>=0
nop
.endif
test eax, eax
jl @F
nop
@@:
Thanks for you reply
>= is JAE (jump if above or equal) ?
I think i must set >
.if eax >ebx jmp if greater or jmp if above
or is this wrong?
Gives a complete opcodes list with this signs (high leve syntax?)
greets
from Randall's instruction ref...
http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_6/CH06-5.html#HEADING5-226
Quote from: ragdog on November 08, 2009, 03:33:45 PM
>= is JAE (jump if above or equal) ?
Yes it is, but watch your step: the high level says .if eax<XXX then do something, the low level says jump, i.e. do nothing if it is above or equal.
hiyas Jochen - Z sends a K
how do you know if you are using signed or unsigned jumps ?
Quote from: dedndave on November 08, 2009, 07:30:37 PM
hiyas Jochen - Z sends a K
how do you know if you are using signed or unsigned jumps ?
hiyas Dave - 2K back ;-)
See attachment above - the red ones are signed. In high level syntax, either use a signed variable:
MySignedVar SDWORD -123, or
.if sdword ptr eaxOne frequent source of trouble is .if eax<0 - that condition is never true...
include \masm32\include\masm32rt.inc
.code
start:
mov eax, -123
.if eax<0
inkey "Wow, eax is less than zero"
.else
inkey "Surprise, eax seems higher than zero...!"
.endif
exit
end start
Thanks for your info and help
And also if Im not mistaken the "<" compare sign is unsigned, it cannot compare a signed number.
yes - i remember something about gt and lt - lol
Jochen - the J's i know - i was asking about the macro stuffage
is it ".gt" for signed ? - or something like that
of course, if i wasn't completely lazy, i could rtfm - lol
Quote from: Farabi on November 09, 2009, 01:09:46 AM
And also if Im not mistaken the "<" compare sign is unsigned, it cannot compare a signed number.
It can, it can... just use .if sdword ptr eax in my example above
Quote from: dedndave on November 09, 2009, 01:29:47 AM
yes - i remember something about gt and lt - lol
Jochen - the J's i know - i was asking about the macro stuffage
is it ".gt" for signed ? - or something like that
of course, if i wasn't completely lazy, i could rtfm - lol
It is gt, but test yourself if that is signed or not - no idea...
Thanks for your help
ebx 123
I use .if eax>ebx ;if eax greater than ebx
jmp out
; or
; .break for stop a loop this
.endif
Thanks
Quote.if sdword ptr eax>ebx ;if eax greater than ebx: SIGNED
nop
.endif
.if eax>ebx ;if eax above ebx: UNSIGNED
nop
.endif