The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: RHL on January 10, 2012, 05:13:28 PM

Title: No understand Instruction JA
Post by: RHL on January 10, 2012, 05:13:28 PM
HEllo All!
I have problem for understand the instruction JA
read information and even I do not understand, could someone please help me to understand how it works  :(
Title: Re: No understand Instruction JA
Post by: qWord on January 10, 2012, 05:20:10 PM
CMP A,B
jump if A above B (unsigned compare).
Title: Re: No understand Instruction JA
Post by: dedndave on January 10, 2012, 05:43:59 PM
http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_6/CH06-5.html#HEADING5-226
Title: Re: No understand Instruction JA
Post by: RHL on January 10, 2012, 05:45:33 PM
@qWord:
Very Thanks man!

@dedndave:
WoW! very goood!  :cheekygreen:
Title: Re: No understand Instruction JA
Post by: jj2007 on January 10, 2012, 06:39:07 PM
Many jxx instructions can be used via .if Zero? etc high level constructs. But there is no .if SignOrZero?, unfortunately.
The SignOrZero? equate below works but uses 4 bytes where 2 would be enough.

include \masm32\include\masm32rt.inc
SignOrZero? equ <Sign? || Zero?> ; 4 bytes, should be 2...
; SignOrZero? equ <!(!Sign? && !Zero?)>  ; doesn't work, Masm bug??
.code
start:
mov eax, 0
cmp eax, 0
; int 3
.if SignOrZero?
print str$(eax), "  SZ", 13, 10
.elseif !SignOrZero?
print str$(eax), "  Not SZ", 13, 10
.else
print str$(eax), "  Other", 13, 10
.endif
mov eax, -1
cmp eax, 0
.if SignOrZero?
print str$(eax), "  SZ", 13, 10
.elseif !SignOrZero?
print str$(eax), "  Not SZ", 13, 10
.else
print str$(eax), "  Other", 13, 10
.endif
mov eax, 1
cmp eax, 0
.if SignOrZero?
print str$(eax), "  SZ", 13, 10
.elseif !SignOrZero?
print str$(eax), "  Not SZ", 13, 10
.else
print str$(eax), "  Other", 13, 10
.endif
inkey "ok"
exit
end start
Title: Re: No understand Instruction JA
Post by: RHL on January 10, 2012, 06:56:09 PM
interesting man...  :clap: