Does anyone have a simpler switch (multiple case) than this below? I would like to decide where to go based on W contents, but not for 256 cases, only a sparse number of them. Look at the code, table, and give your comments, please. It uses 2 temporary storage for compared byte and loop counter. I call it putting in W the value to be compared, the destination case returns at the end. casech equ 0ch tmp equ 0dh ; switch movwf casech clrf tmp swloop movf tmp,w addwf tmp,w ;2*n gets in a 'retlw' instruction call swtable ;andlw 0ffh ;(optional) return if found NULL ;btfsc _z ;return subwf casech,w btfsc _z goto swjmp incf tmp,f goto swloop swjmp movf tmp,w addwf tmp,w addlw 1 ;2*n+1 targets a 'goto' instruction ;goto swtable ;(optional if table don't follows) swtable addwf PCL,f retlw case_a goto rot_a retlw case_b goto rot_b ... ... retlw case_n goto rot_n retlw 0 ;NULL marks end (optional) ; rot_a ... ... return ;returns to main (switch caller) best regards, Rildo Pragana