# The OS/K Team licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. #---------------------------------------------------------------------------# # Logical instructions # #---------------------------------------------------------------------------# # # TEST Comparison instruction # # $1 AND $2 # # Clears OF and CF # Sets ZF and SF according to the result # test r ri # # Bitwise NOT operation # # $1 = NOT($2) # # Preserves all flags # not r r # # Bitwise OR operation # # $dest = $src1 OR $src2 # # Preserves all flags # or r ri or r r ri or m ri or m r ri # $dest = $src1 OR NOT($src2) orn r ri orn r r ri # $dest = NOT($src1 OR $src2) nor r ri nor r r ri # # Bitwise AND operation # # $dest = $src1 AND $src2 # # Preserves all flags # and r rim and r r rim and m ri and m r ri # $dest = $src1 AND NOT($src2) andn r ri andn r r ri # $dest = NOT($src1 AND $src2) nand r ri nand r r ri # # Bitwise XOR operation # # $dest = $src1 XOR $src2 # # Preserves all flags # xor r rim xor r r rim xor m ri xor m r ri # $dest = $src1 XOR NOT($src2) xorn r ri xorn r r ri # $dest = NOT($src1 XOR $src2) xnor r ri xnor r r ri # To document shl r ri shl r r ri shl m ri shl m r ri shr r ri shr r r ri shr m ri shr m r ri sal r ri sal r r ri sal m ri sal m r ri sar r ri sar r r ri sar m ri sar m r ri