<b>
DIPSWT_FUNC:
   MOV   A, P2   ; get the DIP switch value
   ANL   A, #0FH ; mask to the low 4 bits
   MOV   B, #3   ; setup the table index * 3
   MUL   AB      ; A = table index
   MOV   DPTR, #TABLE
   JMP   @A+DPTR ; jump to and through table
;
TABLE:
   LJMP  DIP_SWT_IGNOR  ; swt=0 ignore this combination
   LJMP  DIP_SWT_FUNC1  ; swt=1 go to func 1 handler
   LJMP  DIP_SWT_IGNOR  ; swt=2 ignore this combination
   LJMP  DIP_SWT_IGNOR  ; swt=3 ignore this combination
   LJMP  DIP_SWT_IGNOR  ; swt=4 ignore this combination
   LJMP  DIP_SWT_IGNOR  ; swt=5 ignore this combination
   LJMP  DIP_SWT_FUNC6  ; swt=6 go to func 6 handler
   LJMP  DIP_SWT_IGNOR  ; swt=7 ignore this combination
   LJMP  DIP_SWT_FUNC8  ; swt=8 go to func 8 handler
   LJMP  DIP_SWT_IGNOR  ; swt=9 ignore this combination
   LJMP  DIP_SWT_FUNC10 ; swt=10 go to func 10 handler
   LJMP  DIP_SWT_IGNOR  ; swt=11 ignore this combination
   LJMP  DIP_SWT_FUNC12 ; swt=12 go to func 12 handler
   LJMP  DIP_SWT_IGNOR  ; swt=13 ignore this combination
   LJMP  DIP_SWT_FUNC14 ; swt=14 go to func 14 handler
   LJMP  DIP_SWT_IGNOR  ; swt=15 ignore this combination
;
DIP_SWT_IGNOR:
   RET                  ; exit from subroutine if ignore
;
DIP_SWT_FUNC1:          ; Function 1 handler
    ...
    ...
   RET
;
DIP_SWT_FUNC6:          ; Function 6 handler
    ...
    ...
   RET
;
DIP_SWT_FUNC8:          ; Function 8 handler
    ...
    ...
   RET
;
DIP_SWT_FUNC10:         ; Function 10 handler
    ...
    ...
   RET
;
DIP_SWT_FUNC12:         ; Function 12 handler
    ...
    ...
   RET
;
DIP_SWT_FUNC14:         ; Function 14 handler
    ...
    ...
   RET
;
</b>