RES opcodes implementation