|
3#
楼主 |
发表于 2009-4-25 15:21:55
|
只看该作者
#if defined(__PCM__)
#include <16F877.h>
#fuses HS,NOWDT,PROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=1200, xmit=PIN_C6, rcv=PIN_C7)
#elif defined(__PCH__)
#include <18F452.h>
#fuses HS,NOWDT,PROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=1200, xmit=PIN_C6, rcv=PIN_C7)
#endif
void sub1(int8 i)
{
i++;
}
void sub2(int8 j)
{
j++;
}
void main(void)
{
int8 i,j;
i=0;
j=0;
while(1)
{
sub1(i) ; file://1
sub2(j) ; file://2
sub1(i) ; file://1
sub2(j) ; file://2
sub1(i) ; file://1
sub2(j) ; file://2
}
}
——————————————————————————————
CCS PCH C Compiler, Version 3.187, 16465
Filename: C:\Documents and Settings\lanyong\My Documents\1.LST
ROM used: 104 (0%)
Largest free fragment is 32664
RAM used: 7 (0%) at main() level
8 (1%) worst case
Stack: 1 locations
*
0000: GOTO main
.................... #if defined(__PCM__)
.................... #include <16F877.h>
.................... #fuses HS,NOWDT,PROTECT,NOLVP
.................... #use delay(clock=20000000)
.................... #use rs232(baud=1200, xmit=PIN_C6, rcv=PIN_C7)
....................
.................... #elif defined(__PCH__)
.................... #include <18F452.h>
.................... //////// Standard Header file for the PIC18F452 device ////////////////
.................... #device PIC18F452
.................... #list
....................
.................... #fuses HS,NOWDT,PROTECT,NOLVP
.................... #use delay(clock=20000000)
.................... #use rs232(baud=1200, xmit=PIN_C6, rcv=PIN_C7)
.................... #endif
....................
.................... void sub1(int8 i)
.................... {
0004: NOP(FFFF)
.................... i++;
0006: INCF i,F
.................... }
0008: RETLW 00
000A: NOP(FFFF)
....................
.................... void sub2(int8 j)
.................... {
000C: NOP(FFFF)
.................... j++;
000E: INCF j,F
.................... }
0010: RETLW 00
0012: NOP(FFFF)
....................
.................... void main(void)
.................... {
0014: NOP(FFFF)
0016: CLRF TBLPTRU
0018: BCF RCON.7
001A: CLRF FSR0H
001C: CLRF FSR0L
001E: MOVLW 06
0020: MOVWF ADCON1
0022: MOVLW FF
0024: MOVWF SPBRG
0026: MOVLW 22
0028: MOVWF TXSTA
002A: MOVLW 90
002C: MOVWF RCSTA
.................... int8 i,j;
.................... i=0;
002E: CLRF i
.................... j=0;
0030: CLRF j
....................
.................... while(1)
.................... {
.................... sub1(i) ; file://1
0032: MOVFF i,i
0036: CALL sub1
.................... sub2(j) ; file://2
003A: MOVFF j,j
003E: CALL sub2
....................
.................... sub1(i) ; file://1
0042: MOVFF i,i
0046: CALL sub1
.................... sub2(j) ; file://2
004A: MOVFF j,j
004E: CALL sub2
....................
.................... sub1(i) ; file://1
0052: MOVFF i,i
0056: CALL sub1
.................... sub2(j) ; file://2
005A: MOVFF j,j
005E: CALL sub2
.................... }
0062: GOTO 0032
....................
.................... }
....................
0066: SLEEP
Configuration Fuses:
Word 1: 2200 HS NOOSCSEN
Word 2: 0E0F BROWNOUT WDT128 NOWDT BORV20 NOPUT
Word 3: 0100 CCP2C1
Word 4: 0081 STVREN NODEBUG NOLVP
Word 5: C000 PROTECT NOCPD NOCPB
Word 6: E00F NOWRT NOWRTD NOWRTB NOWRTC
Word 7: 400F NOEBTR NOEBTRB |
|