The structure of the PIC code (was this what Microchip and Scenix were sqabbling over) would make it easy to construct a CASE statement.
CASE x OF
~~0 : y = 3;
~~6 : y = 7
~~1..5 : y = 4
ELSE y = 0;
~~~~~~~~MOVF X,f
~~~~~~~~BTFSC ZERO
~~~~~~~~GOTO YIS3
~~~~~~~~MOVLW .6
~~~~~~~~SUBWF X,w
~~~~~~~~BTFSC ZERO
~~~~~~~~GOTO YIS7
~~~~~~~~BTFSC CARRY 'PIC CODES NOT ~~~~~~~~~~~~~~~~~~~~~~~~' HANDY:BTFSS?
~~~~~~~~GOTO YIS0
~~~~~~~~MOVLW .4
~~~~~~~~MOVWF Y
~~~~~~~~GOTO ENDCASE
YIS3 MOVLW .3
~~~~~~~~MOVWF Y
~~~~~~~~GOTO ENDCASE
YIS7 MOVLW .7
~~~~~~~~MOVWF Y
~~~~~~~~GOTO ENDCASE
YIS0 MOVLW .0
~~~~~~~~MOVWF Y
ENDCASE
And yes, a special case could zero Y differently.
Another alternate would be the table of RETLWs, as in the PBASIC lookup/down instructions.
BTW is there an option available to NOT delete leading spaces when this BB program edits a post ?