implementing some environment handling opcodes