implement BKMS and BKME opcodes