assembly - C code snippets explanation -
i'm trying convert following c code snippets assembly, problem can't understand these simple c code. written in abnormal way think. can't transfer assembly. please me
a = (a >= c); b = (c < d) || (b > d); = (a != d) && (b != c)
look if a>=c
return true. a=1 otherwise a=0. in second case if c<d
(c less d ) or b>d
(b greater d) 1 of them true b=1. if both false b=0. if not equal d , b not equal c a=1 otherwise false(0).
&& b = 1 if a!=0 , b!=0 = 0 if a=0 or b=0 or (a=0 , b=0)
|| b = 1 if a!=0 or b!=0 = 0 if a=0 , b=0
note:
if (a && b)
, found 0 b not checked.if (a || b)
, found 1 b not checked.
if b expression not executed per information stated above. called short circuit evaluation
.
Comments
Post a Comment