;********************************************************************* ; * ; Tutorial 10 Virtual Programmable Logic Circuits * ; * ;********************************************************************* ;* TARGET PIC16C71 ;********************************************************************* ;* @version 0.1, 27 September 2001 ;* @author James Caska ;********************************************************************* list p=16C71 #include ORG .0 GOTO INIT ORG .4 INTERRUPTHANDLER NOP CALL doBooleanLogic BCF INTCON,RBIF RETFIE doBooleanLogic SWAPF PORTB,W CALL BOOLEAN.Table IORLW .0 BTFSC STATUS,Z BCF PORTB,0 BTFSS STATUS,Z BSF PORTB,0 RETURN ;******************************** ; A or (B and C and D) ;******************************** ; ABCD (A and D) or (B and C ) ; 0000 0 ; 0001 0 ; 0010 0 ; 0011 1 ; 0100 0 ; 0101 0 ; 0110 0 ; 0111 1 ; 1000 0 ; 1001 0 ; 1010 0 ; 1011 1 ; 1100 1 ; 1101 1 ; 1110 1 ; 1111 1 ;******************************** BOOLEAN.Table ANDLW .15 ADDWF PCL,F RETLW .0 RETLW .0 RETLW .0 RETLW .1 RETLW .0 RETLW .0 RETLW .0 RETLW .1 RETLW .0 RETLW .0 RETLW .0 RETLW .1 RETLW .1 RETLW .1 RETLW .1 RETLW .1 INIT ;========================================== ;Autogenerated configuration code PIC16C7X ;Config Wiz V0.1, www.virtualbreadboard.com ;========================================== ;======Begin PORT Configuration BSF STATUS,RP0 ;Set Bank1 ;======PORT B MOVLW .254 ;PORTB Configuration Bits MOVWF TRISB BCF STATUS,RP0 ;Restore Bank0 ;========================================== ;Autogenerated configuration code PIC16C71 ;Config Wiz V0.1, www.virtualbreadboard.com ;========================================== ;======Enabled Port B Interrupt BCF INTCON,RBIF ;Clear the PORTB interrupt flag BSF INTCON,RBIE ;Enabled the PORTB interrupt CALL doBooleanLogic BSF INTCON, GIE ;Enable Interrupts MAIN ;Do Whatever here SLEEP NOP GOTO MAIN END