Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Logical OR Operator
- When a compound expression contains subexpressions joined by the OR operator, the overall expression
- is true if any of the subexpressions is true. Let’s use the following pseudocode as an example:
- if (al > bl) OR (bl > cl)
- X = 1
- In the following implementation, the code branches to L1 if the first expression is true; otherwise,
- it falls through to the second CMP instruction. The second expression reverses the > operator
- and uses JBE instead:
- cmp al,bl ; 1: compare AL to BL
- ja L1 ; if true, skip second expression
- cmp bl,cl ; 2: compare BL to CL
- jbe next ; false: skip next statement
- L1: mov X,1 ; true: set X = 1
- next:
- For a given compound expression, there are multiple ways the expression can be implemented
- in assembly language.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement