kvisc/vm/in/LOGIC

104 lines
1.4 KiB
Plaintext

# 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
#
# Clears OF and CF
# Sets ZF and SF according to the result
#
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
#
# Clears OF and CF
# Sets ZF and SF according to the result
#
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
#
# Clears OF and CF
# Sets ZF and SF according to the result
#
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 rim
shl m ri
shr r rim
shr m ri
sal r rim
sal m ri
sar r rim
sar m ri