I've butchered IF.INC to provide a
.and macro. This macro is chainable.
macro .and v1,c,v2
{
if v2 eq & c eq
cmp v1,0
je __ELSE
else if v1 eq & v2 eq
jn#c __ELSE
else
cmp v1,v2
jn#c __ELSE
end if
}
Useage:
.if eax
; You can place code here that will execute if eax != 0
.and ebx
; Code here only executes if (eax != 0) and (ebx !=0)
.and ecx, e, 5
; Code here only executes if (eax != 0) and (ebx !=0) and (ecx == 5)
.elseif ; optional
.else ; optional
.endif
I couldn't figure out how to do
.or. But I believe it needs to invert condition of the jumps in the previous
.if/.and/.or and have that jump target past the cmp of this
.or declaration.
That is so shortcircuiting and chaining work.
Privalov:
local ..else ; What is this for
__ELSE:
restore __ELSE
__ELSE equ ..else ; And this
macro .endif
{
if __IF eq ; Is this required?
__ELSE:
end if