hi all,

for the asm worldwide Genius as you are, i need help in this translation from C:

if (!(callStruct.wFlags & CARRY_FLAG))

i try,

mov ax, callStruct.wFlags
mov bx, CARRY_FLAG
and ax,bx
cmp ax,0
je InThatOtherPlace
here i'm inside condition

Could it be right Tanks :) B7
Posted on 2001-12-05 15:06:30 by Bit7

if (!(callStruct.wFlags & CARRY_FLAG))

This can be re-phrased like this:

if not(callStruct.wFlags AND CARRY_FLAG) then....

so, in MASM syntax, this would look like this (untested):

lea esi, callStruct
assume esi : ptr callStruct
mov eax, [esi].wFlags
.IF !(eax & CARRY_FLAG)
Posted on 2001-12-05 16:07:23 by sluggy
Why you don't say this with a few words instead ?

It means both may not be true for a true result !
Posted on 2001-12-05 17:21:21 by Caleb
many thanks
Posted on 2001-12-06 01:09:39 by Bit7
Try :

test callStruc.wFlags, CARRY_FLAG
jnz Else
; if code
Else :
; else code
Posted on 2001-12-06 01:35:30 by Dr. Manhattan