1: #include <pic.h>
2:
3: __CONFIG(INTIO & OSC_8MHZ & WDTDIS & PWRTEN & MCLRDIS & UNPROTECT & BOREN);
4:
5: void interrupt isr(void)
6: {
7: if (GPIF == 1)
021 1283 BCF 0x3, 0x5
022 1C0B BTFSS 0xb, 0
023 2825 GOTO 0x25
024 2826 GOTO 0x26
025 282C GOTO 0x2c
8: {
9: while(GPIF)
026 2828 GOTO 0x28
028 180B BTFSC 0xb, 0
029 282B GOTO 0x2b
02A 282C GOTO 0x2c
02B 2827 GOTO 0x27
10: GPIF = 0;
027 100B BCF 0xb, 0
11: }
12: }
02C 0871 MOVF 0x71, W
13:
14: main()
15: {
16: TRISIO4 = 1;
00B 1683 BSF 0x3, 0x5
00C 1605 BSF 0x5, 0x4
17: TRISIO1 = 0;
00D 1085 BCF 0x5, 0x1
18: TRISIO2 = 1;
00E 1505 BSF 0x5, 0x2
19: IOC4 = 1;
00F 1616 BSF 0x16, 0x4
20: GPIE = 1;
010 1283 BCF 0x3, 0x5
011 158B BSF 0xb, 0x3
21: ei();
012 178B BSF 0xb, 0x7
22: while(1)
01F 2813 GOTO 0x13
020 280A GOTO 0xa
23: {
24: if (GP4==1)
013 1E05 BTFSS 0x5, 0x4
014 2816 GOTO 0x16
015 2817 GOTO 0x17
016 2819 GOTO 0x19
25: GP1 = 1;
017 1485 BSF 0x5, 0x1
018 281A GOTO 0x1a
26: else
27: GP1 = 0;
019 1085 BCF 0x5, 0x1
28:
29: if (GP2==1)
01A 1D05 BTFSS 0x5, 0x2
01B 281D GOTO 0x1d
01C 281E GOTO 0x1e
01D 281F GOTO 0x1f
30: SLEEP();
31: }
01E 0063 SLEEP