PICC Pro 9.80,MPLAB IDE 8.50,PIC16F883测试编译正常,软件模拟正常。附测试代码及反汇编代码:1: #include <pic.h>
2:
3: unsigned char Index;
4:
5: void main(void)
6: {
7: Index = 0;
786 01F0 CLRF 0x70
8: PORTC = 0;
787 0187 CLRF 0x7
9: TRISC = 0;
788 1683 BSF 0x3, 0x5
789 0187 CLRF 0x7
10: ADCON1 = 0x06;
78A 3006 MOVLW 0x6
78B 009F MOVWF 0x1f
11: while(1)
12: {
13: Index+=1;
7EA 0AF0 INCF 0x70, F
14: if(Index>45) Index = 0;
78C 2FEA GOTO 0x7ea
78D 01F0 CLRF 0x70
78E 2FEF GOTO 0x7ef
7EB 302E MOVLW 0x2e
7EC 0270 SUBWF 0x70, W
7ED 1803 BTFSC 0x3, 0
7EE 2F8D GOTO 0x78d
15: switch(Index)
002 118A BCF 0xa, 0x3
7EF 0870 MOVF 0x70, W
7F0 3EFF ADDLW 0xff
7F1 1C03 BTFSS 0x3, 0
7F2 2FEA GOTO 0x7ea
7F3 0084 MOVWF 0x4
7F4 302D MOVLW 0x2d
7F5 0204 SUBWF 0x4, W
7F6 1803 BTFSC 0x3, 0
7F7 2FEA GOTO 0x7ea
7F8 3000 MOVLW 0
7F9 008A MOVWF 0xa
7FA 1003 BCF 0x3, 0
7FB 0D04 RLF 0x4, W
7FC 3E02 ADDLW 0x2
7FD 0082 MOVWF 0x2
7FE 118A BCF 0xa, 0x3
7FF 2800 GOTO 0
16: {
17: case 1: PORTC = 1; break;
78F 3001 MOVLW 0x1
790 2FE8 GOTO 0x7e8
18: case 2: PORTC = 2; break;
791 3002 MOVLW 0x2
792 2FE8 GOTO 0x7e8
19: case 3: PORTC = 3; break;
793 3003 MOVLW 0x3
794 2FE8 GOTO 0x7e8
20: case 4: PORTC = 4; break;
795 3004 MOVLW 0x4
796 2FE8 GOTO 0x7e8
21: case 5: PORTC = 5; break;
797 3005 MOVLW 0x5
798 2FE8 GOTO 0x7e8
22: case 6: PORTC = 6; break;
799 3006 MOVLW 0x6
79A 2FE8 GOTO 0x7e8
23: case 7: PORTC = 7; break;
79B 3007 MOVLW 0x7
79C 2FE8 GOTO 0x7e8
24: case 8: PORTC = 8; break;
79D 3008 MOVLW 0x8
79E 2FE8 GOTO 0x7e8
25: case 9: PORTC = 9; break;
79F 3009 MOVLW 0x9
7A0 2FE8 GOTO 0x7e8
26: case 10: PORTC = 10; break;
7A1 300A MOVLW 0xa
7A2 2FE8 GOTO 0x7e8
27: case 11: PORTC = 11; break;
7A3 300B MOVLW 0xb
7A4 2FE8 GOTO 0x7e8
28: case 12: PORTC = 12; break;
7A5 300C MOVLW 0xc
7A6 2FE8 GOTO 0x7e8
29: case 13: PORTC = 13; break;
7A7 300D MOVLW 0xd
7A8 2FE8 GOTO 0x7e8
30: case 14: PORTC = 14; break;
7A9 300E MOVLW 0xe
7AA 2FE8 GOTO 0x7e8
31: case 15: PORTC = 15; break;
7AB 300F MOVLW 0xf
7AC 2FE8 GOTO 0x7e8
32: case 16: PORTC = 16; break;
7AD 3010 MOVLW 0x10
7AE 2FE8 GOTO 0x7e8
33: case 17: PORTC = 17; break;
7AF 3011 MOVLW 0x11
7B0 2FE8 GOTO 0x7e8
34: case 18: PORTC = 18; break;
7B1 3012 MOVLW 0x12
7B2 2FE8 GOTO 0x7e8
35: case 19: PORTC = 19; break;
7B3 3013 MOVLW 0x13
7B4 2FE8 GOTO 0x7e8
36: case 20: PORTC = 20; break;
7B5 3014 MOVLW 0x14
7B6 2FE8 GOTO 0x7e8
37: case 21: PORTC = 21; break;
7B7 3015 MOVLW 0x15
7B8 2FE8 GOTO 0x7e8
38: case 22: PORTC = 22; break;
7B9 3016 MOVLW 0x16
7BA 2FE8 GOTO 0x7e8
39: case 23: PORTC = 23; break;
7BB 3017 MOVLW 0x17
7BC 2FE8 GOTO 0x7e8
40: case 24: PORTC = 24; break;
7BD 3018 MOVLW 0x18
7BE 2FE8 GOTO 0x7e8
41: case 25: PORTC = 25; break;
7BF 3019 MOVLW 0x19
7C0 2FE8 GOTO 0x7e8
42: case 26: PORTC = 26; break;
7C1 301A MOVLW 0x1a
7C2 2FE8 GOTO 0x7e8
43: case 27: PORTC = 27; break;
7C3 301B MOVLW 0x1b
7C4 2FE8 GOTO 0x7e8
44: case 28: PORTC = 28; break;
7C5 301C MOVLW 0x1c
7C6 2FE8 GOTO 0x7e8
45: case 29: PORTC = 29; break;
7C7 301D MOVLW 0x1d
7C8 2FE8 GOTO 0x7e8
46: case 30: PORTC = 30; break;
7C9 301E MOVLW 0x1e
7CA 2FE8 GOTO 0x7e8
47: case 31: PORTC = 31; break;
7CB 301F MOVLW 0x1f
7CC 2FE8 GOTO 0x7e8
48: case 32: PORTC = 32; break;
7CD 3020 MOVLW 0x20
7CE 2FE8 GOTO 0x7e8
49: case 33: PORTC = 33; break;
7CF 3021 MOVLW 0x21
7D0 2FE8 GOTO 0x7e8
50: case 34: PORTC = 34; break;
7D1 3022 MOVLW 0x22
7D2 2FE8 GOTO 0x7e8
51: case 35: PORTC = 35; break;
7D3 3023 MOVLW 0x23
7D4 2FE8 GOTO 0x7e8
52: case 36: PORTC = 36; break;
7D5 3024 MOVLW 0x24
7D6 2FE8 GOTO 0x7e8
53: case 37: PORTC = 37; break;
7D7 3025 MOVLW 0x25
7D8 2FE8 GOTO 0x7e8
54: case 38: PORTC = 38; break;
7D9 3026 MOVLW 0x26
7DA 2FE8 GOTO 0x7e8
55: case 39: PORTC = 39; break;
7DB 3027 MOVLW 0x27
7DC 2FE8 GOTO 0x7e8
56: case 40: PORTC = 40; break;
7DD 3028 MOVLW 0x28
7DE 2FE8 GOTO 0x7e8
57: case 41: PORTC = 41; break;
7DF 3029 MOVLW 0x29
7E0 2FE8 GOTO 0x7e8
58: case 42: PORTC = 42; break;
7E1 302A MOVLW 0x2a
7E2 2FE8 GOTO 0x7e8
59: case 43: PORTC = 43; break;
7E3 302B MOVLW 0x2b
7E4 2FE8 GOTO 0x7e8
60: case 44: PORTC = 44; break;
7E5 302C MOVLW 0x2c
7E6 2FE8 GOTO 0x7e8
61: case 45: PORTC = 45; break;
7E7 302D MOVLW 0x2d
7E8 1283 BCF 0x3, 0x5
7E9 0087 MOVWF 0x7
62: }
63: }
64:
65: }
|