CAUTION: UNTESTED CODE
Code:
main:

A var portb.6
B var portb.7
state var byte
if(( A == 1)&&(B==1)) then state = 1
if(( A == 1)&&(B==0)) then state = 2
if(( A == 0)&&(B==1)) then state = 3
if(( A == 0)&&(B==0)) then state = 4
;pause 100
if state = 1 then portC = %00000001
if state = 2 then portc = %00000010
if state = 3 then portc = %00000100
if state = 4 then portc = %00001000

debug "  state = ",#state


goto main