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 :(
CMP A,B
jump if A above B (unsigned compare).
http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_6/CH06-5.html#HEADING5-226
@qWord:
Very Thanks man!
@dedndave:
WoW! very goood! :cheekygreen:
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
interesting man... :clap: