gnupic: Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16


Previous by date: 3 Aug 2006 00:09:29 +0100 Re: [gnupic] Status for C compiler, Jean-Sebastien Stoezel
Next by date: 3 Aug 2006 00:09:29 +0100 Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16, George M. Gallant, Jr.
Previous in thread: 3 Aug 2006 00:09:29 +0100 Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16, Peter Chant
Next in thread: 3 Aug 2006 00:09:29 +0100 Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16, George M. Gallant, Jr.

Subject: Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16
From: "mengjin su" ####@####.####
Date: 3 Aug 2006 00:09:29 +0100
Message-Id: <BAY101-F283778998C96A16F59AE59D0520@phx.gbl>

I did a testing using SDCC (v2.5.0?).  I feel the code efficiency
is not satisfying.  Here is the test C code I wrote:

void strcpy (char *des, char *src)
{
    while ( (*des++ = *src++) ) {}
}

The assembly code SDCC generated is

; ; Starting pCode block
S_main__strcpy	code
_strcpy:
;	.line	11; main.c	void strcpy (char *des, char *src)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVFF	r0x04, POSTDEC1
	MOVFF	r0x05, POSTDEC1
	MOVFF	r0x06, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	MOVLW	0x04
	MOVFF	PLUSW2, r0x02
	MOVLW	0x05
	MOVFF	PLUSW2, r0x03
	MOVLW	0x06
	MOVFF	PLUSW2, r0x04
	MOVLW	0x07
	MOVFF	PLUSW2, r0x05
_00105_DS_:
;	.line	13; main.c	while ( (*des++ = *src++) ) {}
	MOVFF	r0x03, FSR0L
	MOVFF	r0x04, PRODL
	MOVF	r0x05, W
	CALL	__gptrget1
	MOVWF	r0x06
	INCF	r0x03, F
	BTFSC	STATUS, 0
	INCF	r0x04, F
	BTFSC	STATUS, 0
	INCF	r0x05, F
	MOVFF	r0x06, POSTDEC1
	MOVFF	r0x00, FSR0L
	MOVFF	r0x01, PRODL
	MOVF	r0x02, W
	CALL	__gptrput1
	INCF	r0x00, F
	BTFSC	STATUS, 0
	INCF	r0x01, F
	BTFSC	STATUS, 0
	INCF	r0x02, F
	MOVF	r0x06, W
	BTFSS	STATUS, 2
	GOTO	_00105_DS_
	MOVFF	PREINC1, r0x06
	MOVFF	PREINC1, r0x05
	MOVFF	PREINC1, r0x04
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN

What do you think?

- Mengjin -


>From: Peter Chant ####@####.####
>Reply-To: ####@####.####
>To: ####@####.####
>Subject: Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16
>Date: Wed, 2 Aug 2006 08:27:05 +0100
>
>On Wednesday 02 August 2006 01:47, George M. Gallant, Jr. wrote:
> > Pete,
> >
> > I am unable to reproduce your problem. Perhaps it is because I have a
> > older
> > version of sdcc or because I specify the include path in the Makefile.
> >
>
>Thanks,
>
>including the path in the makefile sorted it.  Strange that it was not
>needed for the header files in the pic include sub directory but was in
>the pic16 one.
>
>I've just realised that there is a sdcc-user mailing list.  I suspect I'm
>better of asking questions there.
>
>Thanks.
>
>Pete
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ####@####.####
>For additional commands, e-mail: ####@####.####
>



Previous by date: 3 Aug 2006 00:09:29 +0100 Re: [gnupic] Status for C compiler, Jean-Sebastien Stoezel
Next by date: 3 Aug 2006 00:09:29 +0100 Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16, George M. Gallant, Jr.
Previous in thread: 3 Aug 2006 00:09:29 +0100 Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16, Peter Chant
Next in thread: 3 Aug 2006 00:09:29 +0100 Re: [gnupic] SDCC 2.6.0, finds pic14 header files but not pic16, George M. Gallant, Jr.


Powered by ezmlm-browse 0.20.