Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. Logical OR Operator
  2. When a compound expression contains subexpressions joined by the OR operator, the overall expression
  3. is true if any of the subexpressions is true. Let’s use the following pseudocode as an example:
  4.  
  5. if (al > bl) OR (bl > cl)
  6. X = 1
  7.  
  8. In the following implementation, the code branches to L1 if the first expression is true; otherwise,
  9. it falls through to the second CMP instruction. The second expression reverses the > operator
  10. and uses JBE instead:
  11.  
  12. cmp al,bl ; 1: compare AL to BL
  13. ja L1 ; if true, skip second expression
  14. cmp bl,cl ; 2: compare BL to CL
  15. jbe next ; false: skip next statement
  16. L1: mov X,1 ; true: set X = 1
  17. next:
  18.  
  19. For a given compound expression, there are multiple ways the expression can be implemented
  20. in assembly language.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement