implement opcode 8xy2
refactoring: extracting methods for better readability