Here we have this in MIPS assembler. The first solution is long and bad. The second one with XOR is better.
addi $t0, $0, -5
addi $t1, $0, 15
add $t0, $t0, $t1
sub $t1, $t1, $t0
nor $t1, $0, $t1
addi $t1, $t1, 1
sub $t0, $t0, $t1
####
xor $t0, $t0, $t1
xor $t1, $t0, $t1
xor $t0, $t0, $t1