I'm using a handy switch-case assembler macro that works by XOR'ing the previous case's test value with the current instance's, and testing for zero: .macro switch
.equ prevtest,0
.endm
.macro caseb value,dest
xor.b \value^prevte..
.equ prevtest,0
.endm
.macro caseb value,dest
xor.b \value^prevte..