
Basic Data Operation

This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:


Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |
Comparison |
Matching
Memory Operations
Pointers & references |
Addresses




Task

Write a routine to perform a bitwise AND, OR, and XOR on two integers, a bitwise NOT on the first integer, a left shift, right shift, right arithmetic shift, left rotate, and right rotate.

All shifts and rotates should be done on the first integer with a shift/rotate amount of the second integer.

If any operation is not available in your language, note it.




> v   MCR                                        >v
    1    2       3   4       5            6>61g-:|        8       9
  >&&\481p >88*61p371p >:61g\`!:68*+71g81gp|    7 >61g2/61p71g1+71pv
   >v>v>v>v  <                             >      ^
>#A       1 $^         ^                                           <
  B       6^                   <
   ^>^>^>^1  C                 |!`5p18:+1g18$    <
   ^  9   p#p17*93p189p150     <    >61g71g81gg+71g81gpv D
          >071g81gp          v      ^               <
              AND            >+2\`!#^_>                v
              XOR             +2%  #^_>                v
              OR              +1\`!#^_>                v
              NOT             !    #^_>                v
              LSHFT           0    #^_>48*71g3+81gp    v
              RSHFT           $      48*71g3+81gp  #^_>v E
              END             v    #^_>                >61g2*61pv
                              @    F
                           v_^#                              `2:<
                           >71g81gg.48*71g2+81gp79*1-71g2+81g1+pv
   ^                                    <_v#!`2p15:+1g15p18+1g18<
^                                         < G
 
 